Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ quoted-char = %x0-5B ; omit \
/ %x7D-D7FF ; omit surrogates
/ %xE000-10FFFF

; based on https://www.w3.org/TR/xml/#NT-Nmtoken,
; but cannot start with U+002D HYPHEN-MINUS or U+003A COLON ":"
; literals that do not require quoting
; containing no whitespace and with a restricted range of characters
unquoted = unquoted-start *name-char
unquoted-start = name-start / DIGIT / "."
/ %xB7 / %x300-36F / %x203F-2040
/ "-" ( DIGIT / "." )


; reserve sigils for private-use by implementations
Expand Down
8 changes: 5 additions & 3 deletions spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,10 @@ Implementations MUST NOT distinguish between _quoted_ and _unquoted_ literals
that have the same sequence of code points.

_Unquoted_ literals have a much more restricted range that
is intentionally close to the XML's [Nmtoken](https://www.w3.org/TR/xml/#NT-Nmtoken),
with the restriction that it MUST NOT start with `-` or `:`,
as those would conflict with _function_ start characters.
is intentionally close to XML's [Nmtoken](https://www.w3.org/TR/xml/#NT-Nmtoken).
To make _unquoted_ literals distinct from _function_ names,
a literal MUST be quoted if it begins with a `:`
or if it begins with a `-` that is **not** followed by a `.` or a digit.

```abnf
literal = quoted / unquoted
Expand All @@ -621,6 +622,7 @@ quoted-char = %x0-5B ; omit \
unquoted = unquoted-start *name-char
unquoted-start = name-start / DIGIT / "."
/ %xB7 / %x300-36F / %x203F-2040
/ "-" ( DIGIT / "." )
```

### Names
Expand Down