8000 Add +start and -end sigils for markup elements (#283) · unicode-org/message-format-wg@cfcb688 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfcb688

Browse files
authored
Add +start and -end sigils for markup elements (#283)
1 parent 752dc44 commit cfcb688

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

spec/message.ebnf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ VariantKey ::= Literal | Nmtoken | '*'
1010
Pattern ::= '[' (Text | Placeholder)* ']' /* ws: explicit */
1111

1212
/* Placeholders */
13-
Placeholder ::= '{' (Expression | MarkupStart | MarkupEnd)? '}'
13+
Placeholder ::= '{' (Expression | Markup | MarkupEnd)? '}'
1414

1515
/* Expressions */
1616
Expression ::= Operand Annotation? | Annotation
@@ -19,8 +19,7 @@ Annotation ::= Function Option*
1919
Option ::= Name '=' (Literal | Nmtoken | Variable)
2020

2121
/* Markup Tags */
22-
MarkupStart ::= Name Option*
23-
MarkupEnd ::= '/' Name
22+
Markup ::= MarkupStart Option*
2423

2524
<?TOKENS?>
2625

@@ -38,6 +37,8 @@ AnyChar ::= [#x0-#x10FFFF]
3837
/* Names */
3938
Variable ::= '$' Name /* ws: explicit */
4039
Function ::= ':' Name /* ws: explicit */
40+
MarkupStart ::= '+' Name /* ws: explicit */
41+
MarkupEnd ::= '-' Name /* ws: explicit */
4142
Name ::= NameStart NameChar* /* ws: explicit */
4243
Nmtoken ::= NameChar+ /* ws: explicit */
4344
NameStart ::= [a-zA-Z] | "_"

spec/syntax.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ Examples:
320320
Placeholders can contain expressions and markup elements.
321321

322322
```ebnf
323-
Placeholder ::= '{' (Expression | MarkupStart | MarkupEnd) '}'
323+
Placeholder ::= '{' (Expression | Markup | MarkupEnd) '}'
324324
```
325325

326326
### Expressions
@@ -340,6 +340,8 @@ Expression ::= Operand Annotation? | Annotation
340340
Operand ::= Literal | Variable
341341
Annotation ::= Function Option*
342342
Option ::= Name '=' (Literal | Nmtoken | Variable)
343+
Variable ::= '$' Name /* ws: explicit */
344+
Function ::= ':' Name /* ws: explicit */
343345
```
344346

345347
Examples:
@@ -377,8 +379,9 @@ They mimic XML elements, but do not require well-formedness.
377379
Standalone display elements should be represented as function expressions.
378380

379381
```ebnf
380-
MarkupStart ::= Name Option*
381-
MarkupEnd ::= '/' Name
382+
Markup ::= MarkupStart Option*
383+
MarkupStart ::= '+' Name /* ws: explicit */
384+
MarkupEnd ::= '-' Name /* ws: explicit */
382385
```
383386

384387
Examples:
@@ -412,7 +415,9 @@ AnyChar ::= [#x0-#x10FFFF]
412415
### Names
413416

414417
The _name_ token is used for variable names (prefixed with `$`),
415-
function names (prefixed with `:`) as well as option names.
418+
function names (prefixed with `:`),
419+
markup names (prefixed with `+` or `-`),
420+
as well as option names.
416421
A name cannot start with an ASCII digit and certain basic combining characters.
417422
Otherwise, the set of characters allowed in names is large.
418423

@@ -427,8 +432,6 @@ and [defined in CLDR](https://unicode-org.github.io/cldr-staging/charts/latest/g
427432
uses Nmtokens.
428433

429434
```ebnf
430-
Variable ::= '$' Name /* ws: explicit */
431-
Function ::= ':' Name /* ws: explicit */
432435
Name ::= NameStart NameChar* /* ws: explicit */
433436
Nmtoken ::= NameChar+ /* ws: explicit */
434437
NameStart ::= [a-zA-Z] | "_"

0 commit comments

Comments
 (0)
0