mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Remove "EOF-newline" lexer hack
In preparation for an upcoming change Makes for nicer error messages, complaining about EOF instead of newlines The hack had to be kept for the lexer raw mode to avoid a bug; see the relevant code comment for more info.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
ERROR: block-comment-termination-error.asm(1):
|
||||
Unterminated block comment
|
||||
ERROR: block-comment-termination-error.asm(1):
|
||||
syntax error, unexpected newline
|
||||
syntax error, unexpected end of file
|
||||
error: Assembly aborted (2 errors)!
|
||||
|
||||
6
test/asm/macro-eof.asm
Normal file
6
test/asm/macro-eof.asm
Normal file
@@ -0,0 +1,6 @@
|
||||
; Macro invocations not followed by a newline may scan an EOF;
|
||||
; If this is the case, it shouldn't cause the parse to end before the macro is expanded
|
||||
mac: macro
|
||||
PRINTLN "Hi beautiful"
|
||||
endm
|
||||
mac
|
||||
0
test/asm/macro-eof.err
Normal file
0
test/asm/macro-eof.err
Normal file
1
test/asm/macro-eof.out
Normal file
1
test/asm/macro-eof.out
Normal file
@@ -0,0 +1 @@
|
||||
Hi beautiful
|
||||
@@ -1,4 +1,4 @@
|
||||
recurse: MACRO
|
||||
recurse
|
||||
ENDM
|
||||
recurse
|
||||
recurse
|
||||
|
||||
Binary file not shown.
@@ -3,11 +3,13 @@ SECTION "fixed", ROM0[0]
|
||||
rst @ ; rst 0
|
||||
ld de, @ ; ld de, 1
|
||||
bit @, h ; bit 4, h
|
||||
db @, @ ; db 6, 7
|
||||
jr @ ; jr 6
|
||||
|
||||
SECTION "floating", ROM0
|
||||
|
||||
rst @ ; rst 8
|
||||
ld l, @ ; ld l, 9
|
||||
dw @, @ ; dw 11, 13
|
||||
dl @, @ ; dl 15, 19
|
||||
db @, @ ; db 11, 12
|
||||
dw @, @ ; dw 13, 15
|
||||
dl @, @ ; dl 17, 21
|
||||
jr @ ; jr 25
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user