Only restore parent context's \@ value if it had one defined (#1366)

This way, if a child context initializes `\@`, the parent won't
reset it. And if the child context did not initialize `\@`,
then resetting it would be redundant.
This commit is contained in:
Sylvie
2024-03-21 19:53:49 -04:00
committed by GitHub
parent 0f772932a5
commit f792580816
7 changed files with 108 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
MACRO m1
PRINTLN "Begin MACRO"
DEF nested EQUS """MACRO mm
PRINTLN "Within nested MACRO: \\@"
\n ENDM
mm"""
nested
PURGE nested, mm
PRINTLN "Within MACRO: \@"
ENDM
REPT 2
PRINTLN "Begin REPT"
m1
PRINTLN "Within REPT: \@"
ENDR
PRINTLN
MACRO m2
PRINTLN "Begin MACRO: \@"
DEF nested EQUS """MACRO mm
PRINTLN "Within nested MACRO: \\@"
\n ENDM
mm"""
nested
PURGE nested, mm
PRINTLN "Within MACRO: \@"
ENDM
REPT 2
PRINTLN "Begin REPT: \@"
m2
PRINTLN "Within REPT: \@"
ENDR