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
7 changes: 5 additions & 2 deletions spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ local = %s".local"
match = %s".match"

; Reserve additional .keywords for use by future versions of this specification.
reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression)
reserved-statement = reserved-keyword [s reserved-body-in-statement] 1*([s] expression)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should steer clear of the -in-statement part.

reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression)
reserved-body = reserved-body-start *([s] 1*reserved-body-part)
reserved-body-start = *([s] 1*reserved-body-part)
reserved-body-part = reserved-char / reserved-escape / quoted

I recognize that reserved-body is also used by private-use-annotation. However, the intention there should not be to capture ending whitespace either. private-use-annotation is part of annotation and has the same relationship to e.g. the optional attribute in expression. Trimming private use is thus also desirable to eliminate ambiguity.

; Note that the following production is a simplification,
; as this rule MUST NOT be considered to match existing keywords
; (`.input`, `.local`, and `.match`).
reserved-keyword = "." name
reserved-body-in-statement = reserved-body-in-statement-start *([s] 1*reserved-body-part)
reserved-body-in-statement-start = reserved-body-part

; Reserve additional sigils for use by future versions of this specification.
reserved-annotation = reserved-annotation-start reserved-body
Expand All @@ -67,7 +69,8 @@ reserved-annotation-start = "!" / "%" / "*" / "+" / "<" / ">" / "?" / "~"
; Reserve sigils for private-use by implementations.
private-use-annotation = private-start reserved-body
private-start = "^" / "&"
reserved-body = *([s] 1*(reserved-char / reserved-escape / quoted))
reserved-body = *([s] 1*reserved-body-part)
reserved-body-part = reserved-char / reserved-escape / quoted

; Names and identifiers
; identifier matches https://www.w3.org/TR/REC-xml-names/#NT-QName
Expand Down
7 changes: 5 additions & 2 deletions spec/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ a similarly wide range of content as _reserved annotations_,
but it MUST end with one or more _expressions_.

```abnf
reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression)
reserved-statement = reserved-keyword [s reserved-body-in-statement] 1*([s] expression)
reserved-keyword = "." name
reserved-body-in-statement = reserved-body-in-statement-start *([s] 1*reserved-body-part)
reserved-body-in-statement-start = reserved-body-part
```

> [!Note]
Expand Down Expand Up @@ -656,7 +658,8 @@ unrecognized _reserved-annotations_ or _private-use-annotations_ have no meaning
reserved-annotation = reserved-annotation-start reserved-body
reserved-annotation-start = "!" / "%" / "*" / "+" / "<" / ">" / "?" / "~"

reserved-body = *([s] 1*(reserved-char / reserved-escape / quoted))
reserved-body = *([s] 1*reserved-body-part)
reserved-body-part = reserved-char / reserved-escape / quoted
```

## Markup
Expand Down