Parentheses in macro args prevent commas from starting new arguments

This is similar to C's behavior, and convenient for passing
function calls as single values, like `MUL(3.0, 4.0)` or
`STRSUB("str", 2, 1)`.

Fixes #704
This commit is contained in:
Rangi
2021-04-20 19:50:46 -04:00
committed by Eldred Habert
parent db1f77f90b
commit 27f38770d4
6 changed files with 73 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ STR EQUS "str\"ing"
printargs "literal \"\\\"", \ ; comment 2
"""multi-"line"
""string"" arg"""
printargs MUL(2.0\, 3.0)
printargs MUL(2.0, 3.0)
printargs "unclosed
printlit NUM
@@ -32,7 +32,7 @@ STR EQUS "str\"ing"
printlit "literal \"\\\"", \ ; comment 4
"""multi-"line"
""string"" arg"""
printlit MUL(2.0\, 3.0)
printlit MUL(2.0, 3.0)
printlit this\n is\, \{not\} a\\n syntax\" error
printlit "unclosed
printlit """EOF