File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed
Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,14 @@ asm_file: lines;
404404lines :
405405 %empty
406406 | lines diff_mark line
407+ // Continue parsing the next line on a syntax error
408+ | error {
409+ lexer_SetMode (LEXER_NORMAL);
410+ lexer_ToggleStringExpansion (true );
411+ } endofline {
412+ fstk_StopRept ();
413+ yyerrok ;
414+ }
407415;
408416
409417diff_mark :
@@ -425,14 +433,6 @@ diff_mark:
425433line :
426434 plain_directive endofline
427435 | line_directive // Directives that manage newlines themselves
428- // Continue parsing the next line on a syntax error
429- | error {
430- lexer_SetMode (LEXER_NORMAL);
431- lexer_ToggleStringExpansion (true );
432- } endofline {
433- fstk_StopRept ();
434- yyerrok ;
435- }
436436;
437437
438438endofline : NEWLINE | EOB ;
Original file line number Diff line number Diff line change @@ -6,4 +6,6 @@ error: macro-syntax.asm(8):
66 '\1' cannot be used outside of a macro
77error: macro-syntax.asm(9):
88 syntax error, unexpected ENDM
9- error: Assembly aborted (4 errors)!
9+ error: macro-syntax.asm(11):
10+ "old" is not a macro
11+ error: Assembly aborted (5 errors)!
Original file line number Diff line number Diff line change 2828 mac2 elif , 6 * 7 ; this prints "it's $2A" because it skips the `\1` line and takes the `else`
2929 mac2 elif , 6 * 9
3030 mac2 elif
31- mac2
31+ mac2 ; this prints "args:" *and* "forty-two!" since it doesn't create an `elif`
Original file line number Diff line number Diff line change @@ -2,4 +2,6 @@ error: skip-expansions.asm(31) -> skip-expansions.asm::mac2(21):
22 Macro argument '\1' not defined
33error: skip-expansions.asm(31) -> skip-expansions.asm::mac2(21):
44 syntax error, unexpected (
5- error: Assembly aborted (2 errors)!
5+ error: skip-expansions.asm(31) -> skip-expansions.asm::mac2(21):
6+ Macro argument '\2' not defined
7+ error: Assembly aborted (3 errors)!
Original file line number Diff line number Diff line change 66it's $36
77args: elif
88args:
9+ forty-two!
You can’t perform that action at this time.
0 commit comments