Correctly recover from syntax errors at the first token of a line (#1549)

This commit is contained in:
Sylvie
2024-10-22 15:01:44 -04:00
committed by GitHub
parent f048cbbb11
commit 7fcf4ba60f
5 changed files with 16 additions and 11 deletions

View File

@@ -404,6 +404,14 @@ asm_file: lines;
lines:
%empty
| lines diff_mark line
// Continue parsing the next line on a syntax error
| error {
lexer_SetMode(LEXER_NORMAL);
lexer_ToggleStringExpansion(true);
} endofline {
fstk_StopRept();
yyerrok;
}
;
diff_mark:
@@ -425,14 +433,6 @@ diff_mark:
line:
plain_directive endofline
| line_directive // Directives that manage newlines themselves
// Continue parsing the next line on a syntax error
| error {
lexer_SetMode(LEXER_NORMAL);
lexer_ToggleStringExpansion(true);
} endofline {
fstk_StopRept();
yyerrok;
}
;
endofline: NEWLINE | EOB;