mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Remove column 1 restriction for labels with colons (#635)
Partial fix for #457
This commit is contained in:
@@ -2026,7 +2026,7 @@ static int yylex_NORMAL(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (tokenType == T_ID && lexerState->atLineStart)
|
||||
if (tokenType == T_ID && (lexerState->atLineStart || peek(0) == ':'))
|
||||
return T_LABEL;
|
||||
|
||||
return tokenType;
|
||||
|
||||
30
test/asm/label-indent.asm
Normal file
30
test/asm/label-indent.asm
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
SECTION "Label testing", WRAMX
|
||||
|
||||
Lab:
|
||||
.loc
|
||||
Lab.loc2
|
||||
|
||||
; X = 0
|
||||
; ; Should not believe X is a label!
|
||||
; IF X == 1
|
||||
; FAIL "Wrong!"
|
||||
; ENDC
|
||||
; X \
|
||||
; = 1
|
||||
; IF X != 1
|
||||
; FAIL "Wrong!"
|
||||
; ENDC
|
||||
;
|
||||
; Y equ 42
|
||||
; PRINTT "Y={Y}\n"
|
||||
; PURGE Y
|
||||
;
|
||||
; Y equs "mac"
|
||||
; mac: MACRO
|
||||
; PRINTT "\1\n"
|
||||
; ENDM
|
||||
; ; Should invoke macro Y, and not match "equ" due to the "a" behind it
|
||||
; Y equates 69
|
||||
; Y equsquisite (isn't that English?)
|
||||
; Y eq
|
||||
0
test/asm/label-indent.err
Normal file
0
test/asm/label-indent.err
Normal file
0
test/asm/label-indent.out
Normal file
0
test/asm/label-indent.out
Normal file
Reference in New Issue
Block a user