diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-10-09 16:01:31 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-10-14 12:09:28 +0200 |
commit | 6ad05263426e6f4aae4665d52b9ed1962ab4cd24 (patch) | |
tree | 7b73f563e291eeab944071e0c9a3b9128e924c6b /parser.y | |
parent | 4d1c4e28b8d8368a105717e142f8e920cbf4ea0f (diff) |
lexer: rewrite
Rewrite the lexer into a restartable state machine to support parsing from
file streams without the need to read the entire source text into memory
first.
As a side effect, the length of labels and strings is unlimited now.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -86,9 +86,9 @@ ut_no_empty_obj(struct ut_state *s, uint32_t off) s->error.code = UT_ERROR_UNEXPECTED_TOKEN; if (op) - s->off = op->off; + s->lex.off = op->off; - for (i = 0; i < sizeof(tokennames) / sizeof(tokennames[0]); i++) + for (i = 0; i < __T_MAX; i++) if (yy_find_shift_action(yypParser, (YYCODETYPE)i) < YYNSTATE + YYNRULE) ut_set_error_token(s, i); } |