Skip to content

Commit fdfed1b

Browse files
eemeliaphillips
andauthored
Rename quoted as quoted-literal and unquoted as unquoted-literal (#825)
* Rename `quoted` as `quoted-literal` and `unquoted` as `unquoted-literal` * Keep literal reminder Co-authored-by: Addison Phillips <[email protected]> --------- Co-authored-by: Addison Phillips <[email protected]>
1 parent bc43db8 commit fdfed1b

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

spec/data-model/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ The `Literal` and `VariableRef` correspond to the the _literal_ and _variable_ s
213213
When they are used as the `body` of an `Expression`,
214214
they represent _expression_ values with no _annotation_.
215215

216-
`Literal` represents all literal values, both _quoted_ and _unquoted_.
216+
`Literal` represents all literal values, both _quoted literal_ and _unquoted literal_.
217217
The presence or absence of quotes is not preserved by the data model.
218218
The `value` of `Literal` is the "cooked" value (i.e. escape sequences are processed).
219219

spec/formatting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ after any character escape has been converted to the escaped character.
175175
When a _literal_ is used as an _operand_
176176
or on the right-hand side of an _option_,
177177
the formatting function MUST treat its resolved value the same
178-
whether its value was originally _quoted_ or _unquoted_.
178+
whether its value was originally a _quoted literal_ or an _unquoted literal_.
179179
180180
> For example,
181181
> the _option_ `foo=42` and the _option_ `foo=|42|` are treated as identical.
@@ -361,7 +361,7 @@ An _expression_ fails to resolve when:
361361
362362
The _fallback value_ depends on the contents of the _expression_:
363363
364-
- _expression_ with _literal_ _operand_ (_quoted_ or _unquoted_):
364+
- _expression_ with a _literal_ _operand_ (either quoted or unquoted)
365365
U+007C VERTICAL LINE `|`
366366
followed by the value of the _literal_
367367
with escaping applied to U+005C REVERSE SOLIDUS `\` and U+007C VERTICAL LINE `|`,

spec/message.abnf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ option = identifier [s] "=" [s] (literal / variable)
4242
attribute = "@" identifier [[s] "=" [s] (literal / variable)]
4343

4444
variable = "$" name
45-
literal = quoted / unquoted
46-
quoted = "|" *(quoted-char / escaped-char) "|"
47-
unquoted = name / number-literal
45+
46+
literal = quoted-literal / unquoted-literal
47+
quoted-literal = "|" *(quoted-char / escaped-char) "|"
48+
unquoted-literal = name / number-literal
4849
; number-literal matches JSON number (https://www.rfc-editor.org/rfc/rfc8259#section-6)
49-
number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT]
50+
number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT]
5051

5152
; Keywords; Note that these are case-sensitive
5253
input = %s".input"
@@ -68,7 +69,7 @@ reserved-annotation-start = "!" / "%" / "*" / "+" / "<" / ">" / "?" / "~"
6869
private-use-annotation = private-start [[s] reserved-body]
6970
private-start = "^" / "&"
7071
reserved-body = reserved-body-part *([s] reserved-body-part)
71-
reserved-body-part = reserved-char / escaped-char / quoted
72+
reserved-body-part = reserved-char / escaped-char / quoted-literal
7273

7374
; Names and identifiers
7475
; identifier matches https://www.w3.org/TR/REC-xml-names/#NT-QName

spec/syntax.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ reserved-annotation = reserved-annotation-start [[s] reserved-body]
675675
reserved-annotation-start = "!" / "%" / "*" / "+" / "<" / ">" / "?" / "~"
676676
677677
reserved-body = reserved-body-part *([s] reserved-body-part)
678-
reserved-body-part = reserved-char / escaped-char / quoted
678+
reserved-body-part = reserved-char / escaped-char / quoted-literal
679679
```
680680
681681
## Markup
@@ -834,27 +834,26 @@ except for U+0000 NULL or the surrogate code points U+D800 through U+DFFF.
834834

835835
All code points are preserved.
836836

837-
A **_<dfn>quoted</dfn>_** literal begins and ends with U+005E VERTICAL BAR `|`.
838-
The characters `\` and `|` within a _quoted_ literal MUST be
837+
A **_<dfn>quoted literal</dfn>_** begins and ends with U+005E VERTICAL BAR `|`.
838+
The characters `\` and `|` within a _quoted literal_ MUST be
839839
escaped as `\\` and `\|`.
840840

841-
An **_<dfn>unquoted</dfn>_** literal is a _literal_ that does not require the `|`
841+
An **_<dfn>unquoted literal</dfn>_** is a _literal_ that does not require the `|`
842842
quotes around it to be distinct from the rest of the _message_ syntax.
843-
An _unquoted_ MAY be used when the content of the _literal_
843+
An _unquoted literal_ MAY be used when the content of the _literal_
844844
contains no whitespace and otherwise matches the `unquoted` production.
845-
Any _unquoted_ literal MAY be _quoted_.
846-
Implementations MUST NOT distinguish between _quoted_ and _unquoted_ literals
845+
Implementations MUST NOT distinguish between _quoted literals_ and _unquoted literals_
847846
that have the same sequence of code points.
848847

849-
_Unquoted_ literals can contain a _name_ or consist of a _number-literal_.
848+
_Unquoted literals_ can contain a _name_ or consist of a _number-literal_.
850849
A _number-literal_ uses the same syntax as JSON and is intended for the encoding
851850
of number values in _operands_ or _options_, or as _keys_ for _variants_.
852851

853852
```abnf
854-
literal = quoted / unquoted
855-
quoted = "|" *(quoted-char / escaped-char) "|"
856-
unquoted = name / number-literal
857-
number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT]
853+
literal = quoted-literal / unquoted-literal
854+
quoted-literal = "|" *(quoted-char / escaped-char) "|"
855+
unquoted-literal = name / number-literal
856+
number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT]
858857
```
859858

860859
### Names and Identifiers
@@ -876,7 +875,7 @@ _Option_ _identifiers_ have no prefix.
876875

877876
A **_<dfn>name</dfn>_** is a character sequence used in an _identifier_
878877
or as the name for a _variable_
879-
or the value of an _unquoted_ _literal_.
878+
or the value of an _unquoted literal_.
880879

881880
_Variable_ names are prefixed with `$`.
882881

@@ -934,7 +933,7 @@ An **_<dfn>escape sequence</dfn>_** is a two-character sequence starting with
934933
U+005C REVERSE SOLIDUS `\`.
935934

936935
An _escape sequence_ allows the appearance of lexically meaningful characters
937-
in the body of _text_, _quoted_, or _reserved_
936+
in the body of _text_, _quoted literal_, or _reserved_
938937
(which includes, in this case, _private-use_) sequences.
939938
Each _escape sequence_ represents the literal character immediately following the initial `\`.
940939

@@ -945,7 +944,7 @@ backslash = %x5C ; U+005C REVERSE SOLIDUS "\"
945944

946945
> [!NOTE]
947946
> The `escaped-char` rule allows escaping some characters in places where
948-
> they do not need to be escaped, such as braces in a _quoted_ _literal_.
947+
> they do not need to be escaped, such as braces in a _quoted literal_.
949948
> For example, `|foo {bar}|` and `|foo \{bar\}|` are synonymous.
950949
951950
When writing or generating a _message_, escape sequences SHOULD NOT be used

0 commit comments

Comments
 (0)