Track local label scope, string equated as .. (#1504)

This commit is contained in:
Sylvie
2024-09-18 09:52:30 -04:00
committed by GitHub
parent 197f6cb0ba
commit 9ef2e43bf7
13 changed files with 167 additions and 67 deletions

View File

@@ -1,6 +1,33 @@
section "period", rom0
SECTION "period", ROM0
global1: db 1
.local db 2
. db 3 ; this...
global1 db 4 ; ...expands to this
assert !def(.) && !def(..)
global1:
assert !strcmp("{.}", "global1") && !def(..)
.local1:
assert !strcmp("{.}", "global1") && !strcmp("{..}", "global1.local1")
global1.local2:
assert !strcmp("{.}", "global1") && !strcmp("{..}", "global1.local2")
global2:
assert !strcmp("{.}", "global2") && !def(..)
.local1:
assert !strcmp("{.}", "global2") && !strcmp("{..}", "global2.local1")
LOAD "load", WRAM0
assert !def(.) && !def(..)
wGlobal1:
assert !strcmp("{.}", "wGlobal1") && !def(..)
.wLocal1:
assert !strcmp("{.}", "wGlobal1") && !strcmp("{..}", "wGlobal1.wLocal1")
wGlobal2:
assert !strcmp("{.}", "wGlobal2") && !def(..)
ENDL
assert !strcmp("{.}", "global2") && !strcmp("{..}", "global2.local1")