Avoid treating labels and macros differently in column 1 (#1515)

Fixes #1512
This commit is contained in:
Sylvie
2024-09-22 19:26:25 -04:00
committed by GitHub
parent 15919e550f
commit 6b89938da7
9 changed files with 75 additions and 39 deletions

28
test/asm/lexer-hack.asm Normal file
View File

@@ -0,0 +1,28 @@
MACRO mac
println "got {d:_NARG} args: \#"
ENDM
; indented, these were always macro invocations
mac
mac ro
mac : ld a, 1
; in column 1, we historically treated these as labels
mac
mac ro
mac : ld b, 2
SECTION "test", ROM0
; a colon makes these into labels
Label1: ld c, 3
Label2: ld d, 4
; a macro invocation when already defined as a label
Label1 args
; and a label definition when already defined as a macro
mac: ld e, 5
; the space before the colon matters!
undef :
undef :