Don't rely on new eof ABI in parsers unless --next-abi is passed

This commit is contained in:
Max Brunsfeld 2019-10-31 14:32:10 -07:00
parent d3b7caa565
commit d765332c61
2 changed files with 8 additions and 2 deletions

View file

@ -513,6 +513,13 @@ impl Generator {
);
indent!(self);
add_line!(self, "START_LEXER();");
if self.next_abi {
add_line!(self, "eof = lexer->eof(lexer);");
} else {
add_line!(self, "eof = lookahead == 0;");
}
add_line!(self, "switch (state) {{");
indent!(self);

View file

@ -134,8 +134,7 @@ struct TSLanguage {
lexer->advance(lexer, skip); \
start: \
skip = false; \
lookahead = lexer->lookahead; \
eof = lexer->eof(lexer);
lookahead = lexer->lookahead;
#define ADVANCE(state_value) \
{ \