mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add test for labels when expecting symbols
This commit is contained in:
@@ -1976,7 +1976,7 @@ static Token yylex_NORMAL() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need it to distinguish between label definitions (which start with `LABEL`) and
|
// We need to distinguish between label definitions (which start with `LABEL`) and
|
||||||
// macro invocations (which start with `SYMBOL`).
|
// macro invocations (which start with `SYMBOL`).
|
||||||
//
|
//
|
||||||
// If we had one `IDENTIFIER` token, the parser would need to perform "lookahead" to
|
// If we had one `IDENTIFIER` token, the parser would need to perform "lookahead" to
|
||||||
|
|||||||
9
test/asm/lex-label.asm
Normal file
9
test/asm/lex-label.asm
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
def var: equ 42
|
||||||
|
|
||||||
|
macro mac:
|
||||||
|
endm
|
||||||
|
|
||||||
|
for idx:, 10
|
||||||
|
endr
|
||||||
|
|
||||||
|
newcharmap french:
|
||||||
13
test/asm/lex-label.err
Normal file
13
test/asm/lex-label.err
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
error: lex-label.asm(1):
|
||||||
|
syntax error, unexpected label, expecting symbol
|
||||||
|
error: lex-label.asm(3):
|
||||||
|
syntax error, unexpected label, expecting symbol
|
||||||
|
error: lex-label.asm(4):
|
||||||
|
syntax error, unexpected ENDM
|
||||||
|
error: lex-label.asm(6):
|
||||||
|
syntax error, unexpected label, expecting symbol
|
||||||
|
error: lex-label.asm(7):
|
||||||
|
syntax error, unexpected ENDR
|
||||||
|
error: lex-label.asm(9):
|
||||||
|
syntax error, unexpected label, expecting symbol
|
||||||
|
Assembly aborted with 6 errors!
|
||||||
Reference in New Issue
Block a user