Add test for undefined __SCOPE__

This commit is contained in:
Rangi
2025-10-06 17:51:21 -04:00
parent cca3794dd0
commit cb8c973453
3 changed files with 24 additions and 7 deletions

View File

@@ -3,6 +3,11 @@ assert !DEF(@)
println @ println @
println "{@}?" println "{@}?"
; not inside a section
assert !DEF(__SCOPE__)
println __SCOPE__
println "{__SCOPE__}?"
; not inside a global scope ; not inside a global scope
assert !DEF(.) assert !DEF(.)
println . println .
@@ -23,6 +28,10 @@ assert DEF(@)
println @ println @
println "{@}!" println "{@}!"
assert DEF(__SCOPE__)
println __SCOPE__
println "{__SCOPE__}!"
GlobalScope: GlobalScope:
assert DEF(.) assert DEF(.)
println . println .

View File

@@ -2,16 +2,20 @@ error: PC has no value outside of a section
at undefined-builtins.asm(3) at undefined-builtins.asm(3)
error: Interpolated symbol `@` does not exist error: Interpolated symbol `@` does not exist
at undefined-builtins.asm(4) at undefined-builtins.asm(4)
error: `.` has no value outside of a label scope error: `__SCOPE__` has no value outside of a section
at undefined-builtins.asm(8) at undefined-builtins.asm(8)
error: Interpolated symbol `.` does not exist error: Interpolated symbol `__SCOPE__` does not exist
at undefined-builtins.asm(9) at undefined-builtins.asm(9)
error: `..` has no value outside of a local label scope error: `.` has no value outside of a label scope
at undefined-builtins.asm(13) at undefined-builtins.asm(13)
error: Interpolated symbol `..` does not exist error: Interpolated symbol `.` does not exist
at undefined-builtins.asm(14) at undefined-builtins.asm(14)
error: `_NARG` has no value outside of a macro error: `..` has no value outside of a local label scope
at undefined-builtins.asm(18) at undefined-builtins.asm(18)
error: Interpolated symbol `_NARG` does not exist error: Interpolated symbol `..` does not exist
at undefined-builtins.asm(19) at undefined-builtins.asm(19)
Assembly aborted with 8 errors! error: `_NARG` has no value outside of a macro
at undefined-builtins.asm(23)
error: Interpolated symbol `_NARG` does not exist
at undefined-builtins.asm(24)
Assembly aborted with 10 errors!

View File

@@ -3,11 +3,15 @@ $0
? ?
?
? ?
$0 $0
? ?
$42 $42
$42! $42!
!
$42 $42
GlobalScope! GlobalScope!
$42 $42