Disable EQUS expansion for raw symbols (by parsing them as strings) (#1648)

This commit is contained in:
Rangi
2025-02-15 10:44:51 +01:00
committed by GitHub
parent 3feb75f84f
commit b2e865ee2a
8 changed files with 206 additions and 17 deletions

View File

@@ -0,0 +1,34 @@
opt Wno-unmapped-char
def hello equs "world"
def name equs "hello"
println "{name}"
println #name
assert !strcmp(strsub(#name, 1, 4), "hell")
assert strlen(#hello) == charlen(#hello)
assert strlen("{hello}") == 5
def multi equs """the quick
brown fox"""
println #multi
def char equs "A"
def n = #char
println n
def n = (#char)
println n
def n = 1 + #char
println n
assert #char == $41
def fmt equs "%s %s %d"
println strfmt(#fmt, #name, #hello, (#char))
purge #name
assert !def(name) && !def(#name) && def(hello)
section "test", rom0
#label:
db #hello
dw #hello
dw BANK(#label), #label