-
-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Labels
enhancementTypically new features; lesser priority than bugsTypically new features; lesser priority than bugsrgbasmThis affects RGBASMThis affects RGBASM
Description
Python has """triple""" '''quotes''', bash has << HEREDOC, and ES6 has `template literals`. Any multi-line string literal syntax would be useful, particularly for metaprogramming.
When a macro defines another macro, the inner macro definition is just skipped over until it reaches an ENDM token; this prevents the outer macro from controlling just how the inner one is defined. For that, it needs to use an EQUS. For example:
make_rep: MACRO
REP EQUS "\n\1: MACRO\nREPT \2\n\tdb \\1\nENDR\nENDM"
REP
PURGE REP
ENDM
make_rep double, 2
make_rep triple, 3
double $20 ; db $20, $20
triple $42 ; db $42, $42, $42
Something like this would be more legible:
make_rep: MACRO
REP EQUS """
\1: MACRO
REPT \2
db \\1
ENDR
ENDM"""
REP
PURGE REP
ENDM
Even if the inner macro has to be built up from some STRCATs, the pieces would benefit from multi-line formatting.
Metadata
Metadata
Assignees
Labels
enhancementTypically new features; lesser priority than bugsTypically new features; lesser priority than bugsrgbasmThis affects RGBASMThis affects RGBASM