mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Require underscores to actually be digit separators (#1812)
Multiple, trailing, or next to decimal point are errors
This commit is contained in:
31
test/asm/invalid-underscore.asm
Normal file
31
test/asm/invalid-underscore.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
; good
|
||||
println 123_456
|
||||
println %_1010_1010
|
||||
println 0b_1010_1010
|
||||
println &_555_555
|
||||
println 0o_777_777
|
||||
println $_dead_beef
|
||||
println 0x_cafe_babe
|
||||
println `_0101_2323
|
||||
println 12_34.56_78
|
||||
println 12_34.56_q8
|
||||
|
||||
; bad (multiple '_')
|
||||
println 123__456
|
||||
println %1010__1010
|
||||
println &123__456
|
||||
println $abc__def
|
||||
println `0101__2323
|
||||
println 3.14__15
|
||||
println 2.718__Q16
|
||||
|
||||
; bad (trailing '_')
|
||||
println 12345_
|
||||
println 0b101010_
|
||||
println 0o123456_
|
||||
println 0xabcdef_
|
||||
println `01230123_
|
||||
|
||||
; bad ('_' next to '.')
|
||||
println 1_.618
|
||||
println 2._718
|
||||
Reference in New Issue
Block a user