Handle MACRO and REPT/FOR bodies differently

Fixes #697
This commit is contained in:
Rangi
2021-01-12 21:30:13 -05:00
committed by Eldred Habert
parent a4ebb87858
commit df16e64fc6
9 changed files with 108 additions and 94 deletions

View File

@@ -2,5 +2,5 @@ warning: break.asm(9): [-Wuser]
done 5
warning: break.asm(17): [-Wuser]
OK
FATAL: break.asm(18) -> break.asm::REPT~1(23):
FATAL: break.asm(18) -> break.asm::REPT~1(22):
Ended block with 1 unterminated IF construct

View File

@@ -1,5 +1,6 @@
; This test tries to pass invalid UTF-8 through a macro argument
; to exercise the lexer's reportGarbageChar
m:MACRO \1
m:MACRO
\1
ENDM
m <EFBFBD><EFBFBD>

View File

@@ -1,5 +1,5 @@
ERROR: invalid-utf-8.asm(4) -> invalid-utf-8.asm::m(3):
ERROR: invalid-utf-8.asm(6) -> invalid-utf-8.asm::m(4):
Unknown character 0xCF
ERROR: invalid-utf-8.asm(4) -> invalid-utf-8.asm::m(3):
ERROR: invalid-utf-8.asm(6) -> invalid-utf-8.asm::m(4):
Unknown character 0xD3
error: Assembly aborted (2 errors)!

View File

@@ -1,5 +1,7 @@
warning: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(22): [-Wuser]
Nested macros shouldn't work, whose argument would be \1?
ERROR: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(25):
ERROR: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(24):
Unterminated macro definition
error: Assembly aborted (1 errors)!
ERROR: nested-macrodef.asm(27):
syntax error, unexpected identifier, expecting newline
error: Assembly aborted (2 errors)!

View File

@@ -0,0 +1,7 @@
warning: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(22): [-Wuser]
Nested macros shouldn't work, whose argument would be \1?
ERROR: nested-macrodef.asm(26) -> nested-macrodef.asm::outer(24):
Unterminated macro definition
ERROR: nested-macrodef.asm(27):
syntax error
error: Assembly aborted (2 errors)!