diff options
author | June McEnroe <june@causal.agency> | 2021-01-13 16:04:52 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-01-13 16:04:52 -0500 |
commit | 29b578e6cdede6d9777b8dcf20d09b4aec10ba6c (patch) | |
tree | c602b18e2af839d5acc4af227ad424f0192cfcc8 /bin/hilex.c | |
parent | Try to return strings as single tokens (diff) | |
download | src-29b578e6cdede6d9777b8dcf20d09b4aec10ba6c.tar.gz src-29b578e6cdede6d9777b8dcf20d09b4aec10ba6c.zip |
Move text "lexer" to hilex.c
Diffstat (limited to '')
-rw-r--r-- | bin/hilex.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/hilex.c b/bin/hilex.c index e91442f6..39025961 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; |