Don't rely on new eof ABI in parsers unless --next-abi is passed
This commit is contained in:
parent
d3b7caa565
commit
d765332c61
2 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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) \
|
||||
{ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue