mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Allow underscores in numeric literals
Fixes #539 Changes \@'s output to start with "_u", not "_", so it will be valid within labels but not numerics
This commit is contained in:
21
test/asm/underscore-in-numeric-literal.asm
Normal file
21
test/asm/underscore-in-numeric-literal.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
SECTION "Test", ROM0
|
||||
|
||||
_1234::
|
||||
|
||||
; without underscores
|
||||
dw _1234 ; label
|
||||
db 123, 123, 123 ; decimal
|
||||
dw 12345 ; decimal
|
||||
dw $abcd ; hex
|
||||
db &200 ; octal
|
||||
db %11110000, %10 ; binary
|
||||
dl 6.283185 ; fixed point
|
||||
|
||||
; with underscores
|
||||
dw _1234 ; label
|
||||
db 123, 1_23, 1__23 ; decimal
|
||||
dw 12_345 ; decimal
|
||||
dw $ab_cd ; hex
|
||||
db &2_0_0_ ; octal
|
||||
db %1111_0000, %1_0 ; binary
|
||||
dl 6_._283_185 ; fixed point
|
||||
0
test/asm/underscore-in-numeric-literal.err
Normal file
0
test/asm/underscore-in-numeric-literal.err
Normal file
0
test/asm/underscore-in-numeric-literal.out
Normal file
0
test/asm/underscore-in-numeric-literal.out
Normal file
BIN
test/asm/underscore-in-numeric-literal.out.bin
Normal file
BIN
test/asm/underscore-in-numeric-literal.out.bin
Normal file
Binary file not shown.
@@ -1,19 +1,19 @@
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(4): [-Wuser]
|
||||
_1
|
||||
_u1
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~1(6): [-Wuser]
|
||||
_2
|
||||
_u2
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~2(6): [-Wuser]
|
||||
_3
|
||||
_u3
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(8): [-Wuser]
|
||||
_1
|
||||
_u1
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(4): [-Wuser]
|
||||
_4
|
||||
_u4
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~1(6): [-Wuser]
|
||||
_5
|
||||
_u5
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~2(6): [-Wuser]
|
||||
_6
|
||||
_u6
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(8): [-Wuser]
|
||||
_4
|
||||
_u4
|
||||
FATAL: unique-id.asm(15):
|
||||
Macro argument '\@' not defined
|
||||
while expanding symbol "print"
|
||||
|
||||
Reference in New Issue
Block a user