mirror of
https://github.com/gbdev/rgbds.git
synced 2025-12-06 01:37:47 +00:00
Symbol names with more than two '.'s could be defined as constants
Dot-only names could also trip an assertion in `make develop` when used as labels
This commit is contained in:
2
test/asm/dots-constant.asm
Normal file
2
test/asm/dots-constant.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "test", rom0
|
||||
def #... equs "sublocal"
|
||||
3
test/asm/dots-constant.err
Normal file
3
test/asm/dots-constant.err
Normal file
@@ -0,0 +1,3 @@
|
||||
error: syntax error, unexpected local label, expecting symbol
|
||||
at dots-constant.asm(2)
|
||||
Assembly aborted with 1 error!
|
||||
2
test/asm/dots-interpolate.asm
Normal file
2
test/asm/dots-interpolate.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "test", rom0
|
||||
println "{...}"
|
||||
2
test/asm/dots-interpolate.err
Normal file
2
test/asm/dots-interpolate.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: `...` is a nonsensical reference to a nested local label
|
||||
at dots-interpolate.asm(2)
|
||||
2
test/asm/dots-label.asm
Normal file
2
test/asm/dots-label.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "test", rom0
|
||||
#...:
|
||||
2
test/asm/dots-label.err
Normal file
2
test/asm/dots-label.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: `...` is a nonsensical reference to a nested local label
|
||||
at dots-label.asm(2)
|
||||
4
test/asm/dots-macro-arg.asm
Normal file
4
test/asm/dots-macro-arg.asm
Normal file
@@ -0,0 +1,4 @@
|
||||
MACRO test
|
||||
println "\<...>"
|
||||
ENDM
|
||||
test 1, 2, 3, 4
|
||||
2
test/asm/dots-macro-arg.err
Normal file
2
test/asm/dots-macro-arg.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: `...` is a nonsensical reference to a nested local label
|
||||
at dots-macro-arg.asm::test(2) <- dots-macro-arg.asm(4)
|
||||
@@ -16,3 +16,17 @@ ASSERT DEF(@) && DEF(.) && DEF(..) && DEF(Foo) && DEF(.bar)
|
||||
PRINTLN "PC: {#05X:@}"
|
||||
PRINTLN "global scope: \"{.}\" ({#05X:{.}})"
|
||||
PRINTLN "local scope: \"{..}\" ({#05X:{..}})"
|
||||
|
||||
SECTION "can't redefine", ROM0
|
||||
|
||||
#.
|
||||
#.:
|
||||
#.?
|
||||
DEF #. EQUS "global"
|
||||
jp #.
|
||||
|
||||
#..
|
||||
#..:
|
||||
#..?
|
||||
DEF #.. EQUS "local"
|
||||
jp #..
|
||||
|
||||
@@ -10,4 +10,32 @@ error: Built-in symbol `.` cannot be purged
|
||||
at label-scope.asm(12)
|
||||
error: Built-in symbol `..` cannot be purged
|
||||
at label-scope.asm(12)
|
||||
Assembly aborted with 6 errors!
|
||||
error: `.` is not a macro
|
||||
at label-scope.asm(22)
|
||||
error: `.` is not a macro
|
||||
at label-scope.asm(23)
|
||||
error: `.` is not a macro
|
||||
at label-scope.asm(24)
|
||||
error: `.` is reserved for a built-in symbol
|
||||
at label-scope.asm(25)
|
||||
error: `.` has no value outside of a label scope
|
||||
at label-scope.asm(26)
|
||||
warning: Treating strings as numbers is deprecated; use character literals or `CHARVAL` instead [-Wobsolete]
|
||||
at label-scope.asm(26)
|
||||
error: Strings as numbers must be a single charmap unit
|
||||
at label-scope.asm(26)
|
||||
error: `..` is not a macro
|
||||
at label-scope.asm(28)
|
||||
error: `..` is not a macro
|
||||
at label-scope.asm(29)
|
||||
error: `..` is not a macro
|
||||
at label-scope.asm(30)
|
||||
error: `..` is reserved for a built-in symbol
|
||||
at label-scope.asm(31)
|
||||
error: `..` has no value outside of a local label scope
|
||||
at label-scope.asm(32)
|
||||
warning: Treating strings as numbers is deprecated; use character literals or `CHARVAL` instead [-Wobsolete]
|
||||
at label-scope.asm(32)
|
||||
error: Strings as numbers must be a single charmap unit
|
||||
at label-scope.asm(32)
|
||||
Assembly aborted with 18 errors!
|
||||
|
||||
Reference in New Issue
Block a user