Skip to content

Commit

Permalink
Clarify the absolute nature of "any code point" (#282)
Browse files Browse the repository at this point in the history
Adds explicit mention of cases that are often overlooked.
  • Loading branch information
gibson042 authored Jun 13, 2022
1 parent 19d581b commit 752dc44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/message.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PlainEnd ::= PlainChar - WhiteSpace
/* Text */
Text ::= (TextChar | TextEscape)+
TextChar ::= AnyChar - ('[' | ']' | '{' | '}' | Esc)
AnyChar ::= .
AnyChar ::= [#x0-#x10FFFF]

/* Names */
Variable ::= '$' Name /* ws: explicit */
Expand Down
11 changes: 10 additions & 1 deletion spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ and `\` (which starts an escape sequence).
```ebnf
Text ::= (TextChar | TextEscape)+ /* ws: explicit */
TextChar ::= AnyChar - ('[' | ']' | '{' | '}' | Esc)
AnyChar ::= .
AnyChar ::= [#x0-#x10FFFF]
```

### Names
Expand Down Expand Up @@ -446,6 +446,15 @@ Any Unicode code point is allowed in literals,
with the exception of its delimiters `(` and `)`,
and `\` (which starts an escape sequence).

This includes line-breaking characters (such as U+000A LINE FEED and U+000D CARRIAGE RETURN),
other control characters (such as U+0000 NULL and U+0009 TAB),
permanently reserved noncharacters (U+FDD0 through U+FDEF and U+<i>n</i>FFFE and U+<i>n</i>FFFF where <i>n</i> is 0x0 through 0x10),
surrogate code points (U+D800 through U+DBFF),
private-use code points (U+E000 through U+F8FF, U+F0000 through U+FFFFD, and U+100000 through U+10FFFD),
and unassigned code points.

All code points of a literal are preserved.

```ebnf
Literal ::= '(' (LiteralChar | LiteralEscape)* ')' /* ws: explicit */
LiteralChar ::= AnyChar - ('(' | ')' | Esc)
Expand Down

0 comments on commit 752dc44

Please sign in to comment.