-
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow {symbol} interpolation outside of strings
- Loading branch information
Showing
5 changed files
with
135 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
SECTION "Test", ROM0 | ||
|
||
|
||
p EQUS " 2 + 2 " | ||
pq EQUS "p" | ||
pqr EQUS "pq" | ||
ld a, {pqr} | ||
|
||
|
||
m EQUS "42" | ||
dw 1{m}0, $1{m}0 | ||
|
||
|
||
x = 5 | ||
fmt EQUS "x:" | ||
ld a, x * 2 | ||
ld a, {x} * 2 | ||
bit x, a | ||
bit {x}, a | ||
db $aa, x, $ff | ||
db $aa, {{fmt}x}, $ff | ||
|
||
|
||
s EQUS "\"HELLO\"" | ||
db $aa, s, $ff | ||
db $aa, {s}, $ff | ||
|
||
|
||
MyLabel: | ||
s_mylabel EQUS "MyLabel" | ||
s_test EQUS "\"Test\"" | ||
db BANK(MyLabel) | ||
db BANK({s_mylabel}) | ||
db BANK({s_test}) | ||
|
||
|
||
METAFOO EQUS "FOO" | ||
METAFOO EQUS "Hello world" | ||
_TMP EQUS "PURGE {METAFOO}" | ||
_TMP | ||
PURGE _TMP, METAFOO | ||
ASSERT !DEF(FOO) && !DEF(METAFOO) | ||
|
||
METAFOO EQUS "FOO" | ||
METAFOO EQUS "Hello world" | ||
PURGE {METAFOO}, METAFOO | ||
ASSERT !DEF(FOO) && !DEF(METAFOO) | ||
|
||
METAFOO EQUS "FOO" | ||
{METAFOO} EQUS "Hello world" | ||
PURGE {METAFOO}, METAFOO | ||
ASSERT !DEF(FOO) && !DEF(METAFOO) | ||
|
||
|
||
TM42_MOVE = $2a | ||
n = 42 | ||
|
||
MOVE_FOR_TM EQUS "TM{d:n}_MOVE" | ||
db MOVE_FOR_TM | ||
PURGE MOVE_FOR_TM | ||
|
||
db {TM{d:n}_MOVE} | ||
|
||
|
||
STRUCT_NAME EQUS "mystructname" | ||
CUR_FIELD_ID = 1 | ||
mystructname_field1_name EQUS "myfieldname" | ||
myfieldname EQUS "\"foobar\"" | ||
|
||
TMP EQUS "{STRUCT_NAME}_field{d:CUR_FIELD_ID}_name" | ||
CONFLICTING_FIELD_NAME EQUS TMP | ||
PRINTT "CONFLICTING_FIELD_NAME == \"{CONFLICTING_FIELD_NAME}\"\n" | ||
PURGE TMP | ||
|
||
CONFLICTING_FIELD_NAME_SYM EQUS {STRUCT_NAME}_field{d:CUR_FIELD_ID}_name | ||
PRINTT "CONFLICTING_FIELD_NAME_SYM == \"{CONFLICTING_FIELD_NAME_SYM}\"\n" | ||
|
||
|
||
_NUM_WARPS EQUS "_NUM_WARPS_1" | ||
_NUM_WARPS = 5 | ||
|
||
_WARP_TO_NAME EQUS "_WARP_TO_NUM_{d:{_NUM_WARPS}}" | ||
_WARP_TO_NAME EQUS "warp_to 1, 2, _WARP_TO_WIDTH" | ||
PRINTT "_WARP_TO_NUM_5 == \"{_WARP_TO_NUM_5}\"\n" | ||
PURGE _WARP_TO_NAME | ||
|
||
_WARP_TO_NUM_{d:{_NUM_WARPS}}_SYM EQUS "warp_to 1, 2, _WARP_TO_WIDTH" | ||
PRINTT "_WARP_TO_NUM_5_SYM == \"{_WARP_TO_NUM_5}_SYM\"\n" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CONFLICTING_FIELD_NAME == "foobar" | ||
CONFLICTING_FIELD_NAME_SYM == "foobar" | ||
_WARP_TO_NUM_5 == "warp_to 1, 2, _WARP_TO_WIDTH" | ||
_WARP_TO_NUM_5_SYM == "warp_to 1, 2, _WARP_TO_WIDTH_SYM" |
Binary file not shown.