From f9c7b54b06059061cf1075d277c56b114e90333a Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 11:42:46 -0800 Subject: [PATCH 1/9] Unquoted literals as name or number (NOT READY FOR REVIEW YET) --- spec/message.abnf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/message.abnf b/spec/message.abnf index bd7dbeb8eb..c873fb2049 100644 --- a/spec/message.abnf +++ b/spec/message.abnf @@ -50,9 +50,9 @@ quoted-char = %x0-5B ; omit \ / %x7D-D7FF ; omit surrogates / %xE000-10FFFF -unquoted = unquoted-start *(name-char / ":") -unquoted-start = name-start / DIGIT / "." - / %xB7 / %x300-36F / %x203F-2040 +unquoted = name + / number-literal +number-literal = ["-"] (0 / ([1-9]) *DIGIT [ "." 1*DIGIT] [ (%i"e") ("+"/"-") 1*DIGIT] ; Reserve additional .keywords for use by future versions of this specification. reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression) From b497ce3d141d2ef9a55d59c70c8e43edca912594 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 11:49:46 -0800 Subject: [PATCH 2/9] Update syntax.md --- spec/syntax.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spec/syntax.md b/spec/syntax.md index cf34de5570..03d83d386a 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -699,10 +699,10 @@ Any _unquoted_ literal MAY be _quoted_. 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. +_Unquoted_ literals can contain a _name_ +or consist of a _number-literal_. +A _number-literal_ uses the same syntax as JSON for encoding +number values. ```abnf literal = quoted / unquoted @@ -713,9 +713,9 @@ quoted-char = %x0-5B ; omit \ / %x7D-D7FF ; omit surrogates / %xE000-10FFFF -unquoted = unquoted-start *name-char -unquoted-start = name-start / DIGIT / "." - / %xB7 / %x300-36F / %x203F-2040 +unquoted = name + / number-literal +number-literal = ["-"] (0 / ([1-9]) *DIGIT [ "." 1*DIGIT] [ (%i"e") ("+"/"-") 1*DIGIT] ``` ### Names and Identifiers @@ -732,10 +732,11 @@ _Function_ _identifiers_ are prefixed with `:`, `+`, or `-`. _Option_ _identifiers_ have no prefix. A **_name_** is a character sequence used in an _identifier_ -or as the name for for a _variable_. +or as the name for for a _variable_ +or the value of an _unquoted_ _literal_. _Variable_ names are prefixed with `$`. -for a _function_ (prefixed with `:`, `+` or `-`), +for a _function_ (prefixed with `:`, `+` or `-`). Valid content for _names_ is based on Namespaces in XML 1.0's [NCName](https://www.w3.org/TR/xml-names/#NT-NCName). From 01113f48812681edf1b806284cfb4c495f48120f Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 11:57:21 -0800 Subject: [PATCH 3/9] Update syntax.md --- spec/syntax.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/syntax.md b/spec/syntax.md index 03d83d386a..1a98d38b5e 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -699,10 +699,9 @@ Any _unquoted_ literal MAY be _quoted_. Implementations MUST NOT distinguish between _quoted_ and _unquoted_ literals that have the same sequence of code points. -_Unquoted_ literals can contain a _name_ -or consist of a _number-literal_. -A _number-literal_ uses the same syntax as JSON for encoding -number values. +_Unquoted_ literals can contain a _name_ or consist of a _number-literal_. +A _number-literal_ uses the same syntax as JSON and is intended for the encoding +of number values in _operands_ or _options_, or as _keys_ for _variants_. ```abnf literal = quoted / unquoted From b230b3f78f5fa0155cf3d96cd299289d33c2f615 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:39:12 -0800 Subject: [PATCH 4/9] Update spec/message.abnf Co-authored-by: Eemeli Aro --- spec/message.abnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/message.abnf b/spec/message.abnf index c873fb2049..f8fe6eb234 100644 --- a/spec/message.abnf +++ b/spec/message.abnf @@ -52,7 +52,7 @@ quoted-char = %x0-5B ; omit \ unquoted = name / number-literal -number-literal = ["-"] (0 / ([1-9]) *DIGIT [ "." 1*DIGIT] [ (%i"e") ("+"/"-") 1*DIGIT] +number-literal = ["-"] (0 / ([1-9] *DIGIT) [ "." 1*DIGIT] [ (%i"e") ["+" / "-"] 1*DIGIT] ; Reserve additional .keywords for use by future versions of this specification. reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression) From b149aad41837895349e67bbd97146fc9b39fe601 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:40:31 -0800 Subject: [PATCH 5/9] Update spec/syntax.md Co-authored-by: Eemeli Aro --- spec/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/syntax.md b/spec/syntax.md index 1a98d38b5e..5d7bdc962a 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -714,7 +714,7 @@ quoted-char = %x0-5B ; omit \ unquoted = name / number-literal -number-literal = ["-"] (0 / ([1-9]) *DIGIT [ "." 1*DIGIT] [ (%i"e") ("+"/"-") 1*DIGIT] +number-literal = ["-"] (0 / ([1-9] *DIGIT) [ "." 1*DIGIT] [ (%i"e") ["+" / "-"] 1*DIGIT] ``` ### Names and Identifiers From 757c77b5ceab58fa5be3b589f268fb498dfacfa0 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:43:18 -0800 Subject: [PATCH 6/9] Fix the dangling sentence about function names --- spec/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/syntax.md b/spec/syntax.md index 5d7bdc962a..c4db7f9033 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -735,7 +735,7 @@ or as the name for for a _variable_ or the value of an _unquoted_ _literal_. _Variable_ names are prefixed with `$`. -for a _function_ (prefixed with `:`, `+` or `-`). +_Function_ names are prefixed with `:`, `+` or `-`. Valid content for _names_ is based on Namespaces in XML 1.0's [NCName](https://www.w3.org/TR/xml-names/#NT-NCName). From d9e512fc4163e704e22f163dfa5d66c5bca4e612 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:54:20 -0800 Subject: [PATCH 7/9] Update spec/message.abnf Co-authored-by: Richard Gibson --- spec/message.abnf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/message.abnf b/spec/message.abnf index f8fe6eb234..bba6528351 100644 --- a/spec/message.abnf +++ b/spec/message.abnf @@ -52,7 +52,9 @@ quoted-char = %x0-5B ; omit \ unquoted = name / number-literal -number-literal = ["-"] (0 / ([1-9] *DIGIT) [ "." 1*DIGIT] [ (%i"e") ["+" / "-"] 1*DIGIT] +; number-literal matches JSON number +; https://www.rfc-editor.org/rfc/rfc8259#section-6 +number-literal = ["-"] (0 / ([1-9] *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT] ; Reserve additional .keywords for use by future versions of this specification. reserved-statement = reserved-keyword [s reserved-body] 1*([s] expression) From 457418436e5f0492b829de834d830d70c29f9b61 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:54:30 -0800 Subject: [PATCH 8/9] Update spec/syntax.md Co-authored-by: Richard Gibson --- spec/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/syntax.md b/spec/syntax.md index c4db7f9033..471a924fe9 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -714,7 +714,7 @@ quoted-char = %x0-5B ; omit \ unquoted = name / number-literal -number-literal = ["-"] (0 / ([1-9] *DIGIT) [ "." 1*DIGIT] [ (%i"e") ["+" / "-"] 1*DIGIT] +number-literal = ["-"] (0 / ([1-9] *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"] 1*DIGIT] ``` ### Names and Identifiers From 1ec560519826d96004371ab387a6b78bbb7fa35f Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 4 Dec 2023 12:54:41 -0800 Subject: [PATCH 9/9] Update spec/syntax.md Co-authored-by: Richard Gibson --- spec/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/syntax.md b/spec/syntax.md index 471a924fe9..de78a7b0e3 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -731,7 +731,7 @@ _Function_ _identifiers_ are prefixed with `:`, `+`, or `-`. _Option_ _identifiers_ have no prefix. A **_name_** is a character sequence used in an _identifier_ -or as the name for for a _variable_ +or as the name for a _variable_ or the value of an _unquoted_ _literal_. _Variable_ names are prefixed with `$`.