Implement PRINT and PRINTLN (#672)

Fixes #669
Closes #368
Closes #624

Deprecate PRINTT, PRINTV, PRINTI, and PRINTF

Default STRFMT("%f") to 5 fractional digits like "{f:}"
Any use of string formatting will share this default
This commit is contained in:
Rangi
2021-01-01 20:37:32 -05:00
committed by GitHub
parent 9d2d5cfcfe
commit a70ecba06f
64 changed files with 325 additions and 316 deletions

View File

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