mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 03:52:08 +00:00
Clean up label generation
Only check for localness when we already know we have a local
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
ERROR: label-macro-arg.asm(44) -> label-macro-arg.asm::test_char(31):
|
||||
Local label in main scope
|
||||
Local label 'sizeof_.something' in main scope
|
||||
while expanding symbol "VAR_DEF"
|
||||
ERROR: label-macro-arg.asm(44) -> label-macro-arg.asm::test_char(31):
|
||||
syntax error
|
||||
|
||||
21
test/asm/sym-scope.asm
Normal file
21
test/asm/sym-scope.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
SECTION "Scopes", ROM0
|
||||
|
||||
; Neither of these should be created
|
||||
.tooSoon
|
||||
Nice.try
|
||||
|
||||
Parent:
|
||||
.loc
|
||||
dw Parent.loc ; This is what it should expand to
|
||||
Parent.explicit
|
||||
dw .explicit ; This should expand to the above
|
||||
|
||||
|
||||
; None of the two locals below should manage to be created, being in the wrong scopes
|
||||
; Note however that `Parentheses` begins with `Parent`, which string checks may fail to handle
|
||||
|
||||
Parentheses.check
|
||||
|
||||
Parentheses:
|
||||
|
||||
Parent.check
|
||||
9
test/asm/sym-scope.err
Normal file
9
test/asm/sym-scope.err
Normal file
@@ -0,0 +1,9 @@
|
||||
ERROR: sym-scope.asm(4):
|
||||
Local label '.tooSoon' in main scope
|
||||
ERROR: sym-scope.asm(5):
|
||||
Local label 'Nice.try' in main scope
|
||||
ERROR: sym-scope.asm(17):
|
||||
Not currently in the scope of 'Parentheses.check'
|
||||
ERROR: sym-scope.asm(21):
|
||||
Not currently in the scope of 'Parent.check'
|
||||
error: Assembly aborted (4 errors)!
|
||||
0
test/asm/sym-scope.out
Normal file
0
test/asm/sym-scope.out
Normal file
Reference in New Issue
Block a user