Allow REDEF for EQU constants

Fixes #853
This commit is contained in:
Rangi
2021-04-25 21:06:19 -04:00
committed by Eldred Habert
parent ee67f1039c
commit 8e4ba8d2e4
15 changed files with 99 additions and 6 deletions

23
test/asm/redef-equ.asm Normal file
View File

@@ -0,0 +1,23 @@
DEF n EQU 0
REDEF n EQU 1
; prints "$1"
PRINTLN n
list: MACRO
LIST_NAME EQUS "\1"
DEF LENGTH_{LIST_NAME} EQU 0
ENDM
item: MACRO
REDEF LENGTH_{LIST_NAME} EQU LENGTH_{LIST_NAME} + 1
DEF {LIST_NAME}_{d:LENGTH_{LIST_NAME}} EQU \1
ENDM
list SQUARES
item 1
item 4
item 9
println LENGTH_SQUARES, SQUARES_1, SQUARES_2, SQUARES_3
N EQUS "X"
REDEF N EQU 42