Implement """triple-quoted""" multi-line strings

Fixes #589
This commit is contained in:
Rangi
2020-12-16 12:31:44 -05:00
committed by Eldred Habert
parent ad6f17cd93
commit 255b8bf9ba
5 changed files with 90 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
S EQUS "Hello"
PRINTT "\"\"\"\n"
PRINTT """{S}
world
"""
PRINTT """The multi-line string \ ; line continuations work
can contain:
- "single quotes"
- ""double quotes""
- even escaped \"""triple"\"" ""\"quotes\"\"\"
!"""
PRINTT """\n"""
printarg: MACRO
PRINTT "arg <\1>\n"
PRINTT """arg (\1)\n"""
ENDM
printarg "
printarg """
EMPTY1 EQUS ""
EMPTY2 EQUS "\ ; comment
"
EMPTY3 EQUS """"""
EMPTY4 EQUS """\ ; comment
"""
PRINTT STRCAT("(", "{EMPTY1}", "{EMPTY2}", "{EMPTY3}", "{EMPTY4}", ")\n")

View File

View File

@@ -0,0 +1,13 @@
"""
Hello
world
The multi-line string can contain:
- "single quotes"
- ""double quotes""
- even escaped """triple""" """quotes"""
!
arg <">
arg (")
arg <""">
arg (""")
()