From 9775ce4b5d2afe9d8ef4ca6ba8e06571d55ddba6 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 13 Jan 2021 16:04:52 -0500 Subject: Move text "lexer" to hilex.c --- bin/hilex.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/hilex.c') diff --git a/bin/hilex.c b/bin/hilex.c index afcc5000..a5c682ac 100644 --- a/bin/hilex.c +++ b/bin/hilex.c @@ -35,6 +35,14 @@ static const char *Class[] = { #undef X }; +static FILE *yyin; +static char *yytext; +static int yylex(void) { + static size_t cap = 0; + return (getline(&yytext, &cap, yyin) < 0 ? None : Normal); +} +static const struct Lexer LexText = { yylex, &yyin, &yytext }; + static const struct { const struct Lexer *lexer; const char *name; -- cgit 1.4.1