Skip to content

Commit 64743ff

Browse files
committed
discuss more value literal delimiters
1 parent 572caeb commit 64743ff

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spec/compromise-syntax.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ and we also allow for invoking functions without using argument names or value l
6262
{$name}
6363
{$count :number}
6464
{$fraction :number style=percent minFractions=2}
65-
{<25> :number}
65+
{(25) :number}
6666
{:specialFunction optionKey=optionValue key2=<value with spaces>}
6767
```
6868

@@ -111,9 +111,16 @@ then its string value is used verbatim and it is read-only for translators.
111111
- TODO: Value literals need to be delimited (they may contain spaces),
112112
and the starting delimiter needs to be distinct from the prefixes for
113113
argument names and functions.
114-
Reasonable choices include `<>`, `()`, `[]`, or `||`.
114+
Reasonable choices include `<>`, `()`, `[]`, `||`, or a pair of `` characters.
115+
We could actually allow *both* `''` and `""` so that
116+
a programmer who puts a message string into a string literal using one of these delimiters
117+
could escape a value literal using the opposite delimiter.
115118
Consider that the same delimiters should also be usable (not visually confusing)
116119
when used in a list of selection values (see below); that probably excludes `||` and `[]`.
120+
For a list of space-separated literals,
121+
it would be best to use a pair of delimiters that visually indicate and distinguish
122+
the start and end of each literal. That suggests using `()`.
123+
For example: `[(ab c) (d ef) (g h)]`
117124
- TODO: Define escaping inside constant values.
118125
Probably the pattern escapes plus escapes for the constant delimiters.
119126

0 commit comments

Comments
 (0)