Skip to content

Commit d18d64f

Browse files
authored
Change the literal delimiter to the vertical pipe character. (#359)
Closes #263.
1 parent dee9a34 commit d18d64f

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

spec/formatting.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ These are divided into the following categories:
4444
```
4545

4646
```
47-
let $var = {(no message body)}
47+
let $var = {|no message body|}
4848
```
4949

5050
- **Data Model errors** occur when a message is invalid due to
@@ -112,11 +112,11 @@ These are divided into the following categories:
112112
does not provide for the function `:func` to be successfully resolved:
113113
114114
```
115-
{The value is {(horse) :func}.}
115+
{The value is {|horse| :func}.}
116116
```
117117
118118
```
119-
match {(horse) :func}
119+
match {|horse| :func}
120120
when 1 {The value is one.}
121121
when * {The value is not one.}
122122
```
@@ -130,13 +130,13 @@ These are divided into the following categories:
130130
uses a `:plural` selector function which requires its input to be numeric:
131131
132132
```
133-
match {(horse) :plural}
133+
match {|horse| :plural}
134134
when 1 {The value is one.}
135135
when * {The value is not one.}
136136
```
137137
138138
```
139-
let $sel = {(horse) :plural}
139+
let $sel = {|horse| :plural}
140140
match {$sel}
141141
when 1 {The value is one.}
142142
when * {The value is not one.}
@@ -157,7 +157,7 @@ These are divided into the following categories:
157157
an option `field` to be provided with a string value,
158158
159159
```
160-
{Hello, {(horse) :get field=name}!}
160+
{Hello, {|horse| :get field=name}!}
161161
```
162162
163163
```
@@ -211,11 +211,11 @@ always starts with U+007B LEFT CURLY BRACKET `{`
211211
and ends with U+007D RIGHT CURLY BRACKET `}`.
212212
Between the brackets, the following contents are used:
213213
214-
- Expression with Literal Operand: U+0028 LEFT PARENTHESIS `(`
214+
- Expression with Literal Operand: U+007C VERTICAL LINE `|`
215215
followed by the value of the Literal,
216-
and then by U+0029 RIGHT PARENTHESIS `)`
216+
and then by U+007C VERTICAL LINE `|`
217217
218-
Examples: `{(horse)}`, `{(42)}`
218+
Examples: `{|horse|}`, `{|42|}`
219219
220220
- Expression with Variable Operand: U+0024 DOLLAR SIGN `$`
221221
followed by the Variable Name of the Operand
@@ -249,17 +249,17 @@ For example, attempting to format either of the following messages within a cont
249249
does not provide for the function `:func` to be successfully resolved:
250250
251251
```
252-
let $var = {(horse) :func}
252+
let $var = {|horse| :func}
253253
{The value is {$var}.}
254254
```
255255
256256
```
257-
let $var = {(horse)}
257+
let $var = {|horse|}
258258
{The value is {$var :func}.}
259259
```
260260
261261
would result in both cases with this formatted string representation:
262262
263263
```
264-
The value is {(horse)}.
264+
The value is {|horse|}.
265265
```

spec/message.abnf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ text-char = %x0-5B ; omit \
3232
/ %xE000-10FFFF
3333

3434
literal = "(" *(literal-char / literal-escape) ")"
35-
literal-char = %x0-27 ; omit ( and )
36-
/ %x2A-5B ; omit \
37-
/ %x5D-D7FF ; omit surrogates
35+
literal-char = %x0-5B ; omit \
36+
/ %x5D-7B ; omit |
37+
/ %x7D-D7FF ; omit surrogates
3838
/ %xE000-10FFFF
3939

4040
variable = "$" name
@@ -53,7 +53,7 @@ name-char = name-start / DIGIT / "-" / "." / %xB7
5353
/ %x0300-036F / %x203F-2040
5454

5555
text-escape = backslash ( backslash / "{" / "}" )
56-
literal-escape = backslash ( backslash / "(" / ")" )
56+
literal-escape = backslash ( backslash / "|" )
5757
backslash = %x5C ; U+005C REVERSE SOLIDUS "\"
5858

5959
s = 1*( SP / HTAB / CR / LF )

spec/syntax.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,15 @@ option = name [s] "=" [s] (literal / nmtoken / variable)
372372
Examples:
373373

374374
```
375-
(1.23)
375+
|1.23|
376376
```
377377

378378
```
379-
(1.23) :number maxFractionDigits=1
379+
|1.23| :number maxFractionDigits=1
380380
```
381381

382382
```
383-
(1970-01-01T13:37:00.000Z) :datetime weekday=long
384-
```
385-
386-
```
387-
(Thu Jan 01 1970 14:37:00 GMT+0100 \(CET\)) :datetime weekday=long
383+
|Thu Jan 01 1970 14:37:00 GMT+0100 (CET)| :datetime weekday=long
388384
```
389385

390386
```
@@ -433,7 +429,7 @@ when = %x77.68.65.6E ; "when"
433429
_Text_ is the translatable content of a _pattern_, and _Literal_ is used for matching
434430
variants and providing input to expressions.
435431
Any Unicode code point is allowed in either, with the exception of
436-
the relevant delimiters (`{` and `}` for Text, `(` and `)` for Literal),
432+
the relevant delimiters (`{` and `}` for Text, `|` for Literal),
437433
`\` (which starts an escape sequence), and
438434
surrogate code points U+D800 through U+DBFF (which cannot be encoded into UTF-8).
439435

@@ -450,9 +446,9 @@ text-char = %x0-5B ; omit \
450446

451447
```abnf
452448
literal = "(" *(literal-char / literal-escape) ")"
453-
literal-char = %x0-27 ; omit ( and )
454-
/ %x2A-5B ; omit \
455-
/ %x5D-D7FF ; omit surrogates
449+
literal-char = %x0-5B ; omit \
450+
/ %x5D-7B ; omit |
451+
/ %x7D-D7FF ; omit surrogates
456452
/ %xE000-10FFFF
457453
```
458454

@@ -501,7 +497,7 @@ They are allowed in translatable text as well as in literals.
501497

502498
```abnf
503499
text-escape = backslash ( backslash / "{" / "}" )
504-
literal-escape = backslash ( backslash / "(" / ")" )
500+
literal-escape = backslash ( backslash / "|" )
505501
backslash = %x5C ; U+005C REVERSE SOLIDUS "\"
506502
```
507503

0 commit comments

Comments
 (0)