summaryrefslogtreecommitdiffhomepage
path: root/parser.y
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-09 16:01:31 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-14 12:09:28 +0200
commit6ad05263426e6f4aae4665d52b9ed1962ab4cd24 (patch)
tree7b73f563e291eeab944071e0c9a3b9128e924c6b /parser.y
parent4d1c4e28b8d8368a105717e142f8e920cbf4ea0f (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.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.y b/parser.y
index 11bf3b6..0ee4f30 100644
--- a/parser.y
+++ b/parser.y
@@ -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);
}