Support 'MACRO mac' as well as 'mac: MACRO' for defining macros

The new syntax is used in documentation, but
the old syntax is not yet deprecated.
This commit is contained in:
Rangi
2021-02-23 15:57:21 -05:00
committed by Eldred Habert
parent 3c5e1caa7c
commit 953f79c0d9
6 changed files with 59 additions and 19 deletions
+15
View File
@@ -0,0 +1,15 @@
old: MACRO ; comment
println "out with the ", \1
ENDM ; comment
MACRO new ; comment
println "in with the ", \1
ENDM ; comment
old 1
new 2
bad1: MACRO bad2 ; comment
println "which?"
ENDM ; comment
+5
View File
@@ -0,0 +1,5 @@
ERROR: macro-syntax.asm(13):
syntax error, unexpected identifier, expecting newline
ERROR: macro-syntax.asm(15):
syntax error, unexpected ENDM
error: Assembly aborted (2 errors)!
+3
View File
@@ -0,0 +1,3 @@
out with the $1
in with the $2
which?
+5
View File
@@ -0,0 +1,5 @@
ERROR: macro-syntax.asm(13):
syntax error
ERROR: macro-syntax.asm(15):
syntax error
error: Assembly aborted (2 errors)!