Allow error messages for subsequent syntax errors (#892)

Fixes #891
This commit is contained in:
Rangi
2021-05-21 17:04:27 -04:00
committed by GitHub
parent e3b7339dd6
commit 5ad48851ed
6 changed files with 38 additions and 1 deletions

View File

@@ -686,6 +686,7 @@ line : plain_directive endofline
| line_directive /* Directives that manage newlines themselves */ | line_directive /* Directives that manage newlines themselves */
| error endofline { /* Continue parsing the next line on a syntax error */ | error endofline { /* Continue parsing the next line on a syntax error */
fstk_StopRept(); fstk_StopRept();
yyerrok;
} }
; ;

View File

@@ -1,6 +1,8 @@
ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(25): ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(25):
syntax error, unexpected = syntax error, unexpected =
while expanding symbol "VAR_DEF" while expanding symbol "VAR_DEF"
ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(26):
syntax error, unexpected =
ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(29): ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(29):
Interpolated symbol "sizeof_.something" does not exist Interpolated symbol "sizeof_.something" does not exist
ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25): ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25):
@@ -16,4 +18,4 @@ ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
Invalid format spec 'sizeof_' Invalid format spec 'sizeof_'
ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29): ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
Interpolated symbol "something" does not exist Interpolated symbol "something" does not exist
error: Assembly aborted (8 errors)! error: Assembly aborted (9 errors)!

View File

@@ -0,0 +1,10 @@
MACRO mac
println "got {d:_NARG} args"
ENDM
mac
mac 42
notmac
mac
mac 42
mac::
mac ::

View File

@@ -0,0 +1,11 @@
ERROR: syntax-error-after-syntax-error.asm(6):
syntax error, unexpected newline
ERROR: syntax-error-after-syntax-error.asm(7):
syntax error, unexpected newline
ERROR: syntax-error-after-syntax-error.asm(8):
syntax error, unexpected number
ERROR: syntax-error-after-syntax-error.asm(9):
'mac' already defined at syntax-error-after-syntax-error.asm(1)
ERROR: syntax-error-after-syntax-error.asm(10):
'mac' already defined at syntax-error-after-syntax-error.asm(1)
error: Assembly aborted (5 errors)!

View File

@@ -0,0 +1,2 @@
got 0 args
got 1 args

View File

@@ -0,0 +1,11 @@
ERROR: syntax-error-after-syntax-error.asm(6):
syntax error
ERROR: syntax-error-after-syntax-error.asm(7):
syntax error
ERROR: syntax-error-after-syntax-error.asm(8):
syntax error
ERROR: syntax-error-after-syntax-error.asm(9):
'mac' already defined at syntax-error-after-syntax-error.asm(1)
ERROR: syntax-error-after-syntax-error.asm(10):
'mac' already defined at syntax-error-after-syntax-error.asm(1)
error: Assembly aborted (5 errors)!