Skip to content

Specify private reserved sigils ^ and & #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2023
Merged
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
8 changes: 5 additions & 3 deletions spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ unquoted = unquoted-start *name-char
unquoted-start = name-start / DIGIT / "."
/ %xB7 / %x300-36F / %x203F-2040

; reserve additional sigils for future use
reserved = reserved-start reserved-body
reserved-start = "!" / "@" / "#" / "%" / "^" / "&" / "*" / "<" / ">" / "?" / "~"
; reserve additional sigils for use by future versions of this
; specification or for private use by implementations
reserved = ( reserved-start / private-start ) reserved-body
reserved-start = "!" / "@" / "#" / "%" / "*" / "<" / ">" / "/" / "?" / "~"
private-start = "^" / "&"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should discuss as a group which characters to reserve for private use, although these seem as good as any.

reserved-body = *( [s] 1*(reserved-char / reserved-escape / literal))
reserved-char = %x00-08 ; omit HTAB and LF
/ %x0B-0C ; omit CR
Expand Down
34 changes: 30 additions & 4 deletions spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,40 @@ option = name [s] "=" [s] (literal / variable)

#### Reserved

**_Reserved_** sequences start with a reserved character
and are intended for future standardization.
A reserved sequence MAY be empty or contain arbitrary text.
A reserved sequence does not include any trailing whitespace.
**_Reserved_** annotations start with a reserved character
and are intended for future standardization
as well as private implementation use.
A _reserved_ _annotation_ MAY be empty or contain arbitrary text.
This allows maximum flexibility in future standardization,
as future definitions are expected to define additional semantics and constraints
on the contents of these _annotations_.
A _reserved_ _annotation_ does not include trailing whitespace.

Implementations MAY define their own meaning and semantics for
_reserved_ annotations that start with
the U+0026 AMPERSAND `&` or U+005E CIRCUMFLEX ACCENT `^` characters.
Implementations MUST NOT assign meaning or semantics to
an _annotation_ starting with `reserved-start`:
these are reserved for future standardization.
Implementations MUST NOT remove or alter the contents of a _reserved_ _annotation_.

While a reserved sequence is technically "well-formed",
unrecognized reserved sequences have no meaning and MAY result in errors during formatting.

```abnf
reserved = ( reserved-start / private-start ) reserved-body
reserved-start = "!" / "@" / "#" / "%" / "*" / "<" / ">" / "/" / "?" / "~"
private-start = "^" / "&"
reserved-body = *( [s] 1*(reserved-char / reserved-escape / literal))
reserved-char = %x00-08 ; omit HTAB and LF
/ %x0B-0C ; omit CR
/ %x0E-19 ; omit SP
/ %x21-5B ; omit \
/ %x5D-7A ; omit { | }
/ %x7E-D7FF ; omit surrogates
/ %xE000-10FFFF
```

## Tokens

The grammar defines the following tokens for the purpose of the lexical analysis.
Expand Down