mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 19:22:05 +00:00
Syntax errors resets the lexer right away
`DEF`, `REDEF`, etc disable EQUS expansion, and reading macro or OPT arguments sets the lexer to raw mode. Syntax errors resume normal parsing at the line's end, but should resume normal tokenization even before that.
This commit is contained in:
@@ -684,11 +684,19 @@ plain_directive : label
|
||||
|
||||
line : plain_directive endofline
|
||||
| line_directive /* Directives that manage newlines themselves */
|
||||
| error endofline { /* Continue parsing the next line on a syntax error */
|
||||
/* Continue parsing the next line on a syntax error */
|
||||
| error {
|
||||
lexer_SetMode(LEXER_NORMAL);
|
||||
lexer_ToggleStringExpansion(true);
|
||||
} endofline {
|
||||
fstk_StopRept();
|
||||
yyerrok;
|
||||
}
|
||||
| T_LABEL error endofline { /* Hint about unindented macros parsed as labels */
|
||||
/* Hint about unindented macros parsed as labels */
|
||||
| T_LABEL error {
|
||||
lexer_SetMode(LEXER_NORMAL);
|
||||
lexer_ToggleStringExpansion(true);
|
||||
} endofline {
|
||||
struct Symbol *macro = sym_FindExactSymbol($1);
|
||||
|
||||
if (macro && macro->type == SYM_MACRO)
|
||||
|
||||
Reference in New Issue
Block a user