mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Implement __SCOPE__ (#1845)
This commit is contained in:
27
test/asm/scope-level.asm
Normal file
27
test/asm/scope-level.asm
Normal file
@@ -0,0 +1,27 @@
|
||||
assert !def(__SCOPE__)
|
||||
|
||||
section "test", rom0
|
||||
|
||||
assert !def(.)
|
||||
assert !def(..)
|
||||
assert #__SCOPE__ === ""
|
||||
|
||||
Alpha.local1:
|
||||
assert !def(.)
|
||||
assert #.. === "Alpha.local1"
|
||||
assert #__SCOPE__ === ".."
|
||||
|
||||
Beta:
|
||||
assert #. === "Beta"
|
||||
assert !def(..)
|
||||
assert #__SCOPE__ === "."
|
||||
|
||||
Alpha.local2:
|
||||
assert #. === "Beta"
|
||||
assert #.. === "Alpha.local2"
|
||||
assert #__SCOPE__ === ".."
|
||||
|
||||
.newLocal:
|
||||
assert #. === "Beta"
|
||||
assert #.. === "Beta.newLocal"
|
||||
assert #__SCOPE__ === ".."
|
||||
Reference in New Issue
Block a user