ref: 5ad48851ed3c40d5b7c78313eebb691f31124da3
parent: e3b7339dd626efd40224e58f22b660dc0367f0aa
author: Rangi <[email protected]>
date: Fri May 21 13:04:27 EDT 2021
Allow error messages for subsequent syntax errors (#892) Fixes #891
--- a/src/asm/parser.y
+++ b/src/asm/parser.y
@@ -686,6 +686,7 @@
| line_directive /* Directives that manage newlines themselves */
| error endofline { /* Continue parsing the next line on a syntax error */
fstk_StopRept();
+ yyerrok;
}
;
--- a/test/asm/label-macro-arg.err
+++ b/test/asm/label-macro-arg.err
@@ -1,6 +1,8 @@
ERROR: label-macro-arg.asm(38) -> label-macro-arg.asm::test_char(25):
syntax error, unexpected =
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):
Interpolated symbol "sizeof_.something" does not exist
ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(25):
@@ -16,4 +18,4 @@
Invalid format spec 'sizeof_'
ERROR: label-macro-arg.asm(39) -> label-macro-arg.asm::test_char(29):
Interpolated symbol "something" does not exist
-error: Assembly aborted (8 errors)!
+error: Assembly aborted (9 errors)!
--- /dev/null
+++ b/test/asm/syntax-error-after-syntax-error.asm
@@ -1,0 +1,10 @@
+MACRO mac
+ println "got {d:_NARG} args"
+ENDM
+ mac
+ mac 42
+notmac
+mac
+mac 42
+mac::
+mac ::
--- /dev/null
+++ b/test/asm/syntax-error-after-syntax-error.err
@@ -1,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)!
--- /dev/null
+++ b/test/asm/syntax-error-after-syntax-error.out
@@ -1,0 +1,2 @@
+got 0 args
+got 1 args
--- /dev/null
+++ b/test/asm/syntax-error-after-syntax-error.simple.err
@@ -1,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)!