mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Avoid treating labels and macros differently in column 1 (#1515)
Fixes #1512
This commit is contained in:
28
test/asm/lexer-hack.asm
Normal file
28
test/asm/lexer-hack.asm
Normal 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 :
|
||||
Reference in New Issue
Block a user