From f2e9c7d0b4856e62406fe10ab594218cf697b8ec Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Tue, 2 Jan 2024 00:38:57 +0200 Subject: [PATCH 1/3] Clarify that Duplicate Option Name is a data model error --- spec/formatting.md | 2 -- spec/syntax.md | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/formatting.md b/spec/formatting.md index 74900c6e50..3ce7af2830 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -214,8 +214,6 @@ the following steps are taken: If _options_ is missing, the mapping will be empty. For each _option_: - Resolve the _identifier_ of the _option_. - - If the _option_'s _identifier_ already exists in the resolved mapping of _options_, - emit a Duplicate Option Name error. - If the _option_'s right-hand side successfully resolves to a value, bind the _identifier_ of the _option_ to the resolved value in the mapping. - Otherwise, bind the _identifier_ of the _option_ to an unresolved value in the mapping. diff --git a/spec/syntax.md b/spec/syntax.md index 1add87f16d..fd01f00d21 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -89,7 +89,8 @@ Attempting to parse a _message_ that is not _well-formed_ will result in a _Synt A _message_ is **_valid_** if it is _well-formed_ and **also** meets the additional content restrictions -and semantic requirements about its structure defined below. +and semantic requirements about its structure defined below for +_declarations_, _matcher_ and _options_. Attempting to parse a _message_ that is not _valid_ will result in a _Data Model Error_. ## The Message @@ -554,6 +555,9 @@ The value of an _option_ can be either a _literal_ or a _variable_. Multiple _options_ are permitted in an _annotation_. Each _option_ is separated by whitespace. +The _option_ _identifiers_ MUST be unique within each _expression_. +Otherwise, the _message_ is not considered _valid_. + ```abnf option = identifier [s] "=" [s] (literal / variable) ``` From e4e307c7b2b8d7b2675c5f5a584abf1b7993f2fc Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Tue, 2 Jan 2024 19:30:15 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Addison Phillips --- spec/syntax.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/syntax.md b/spec/syntax.md index fd01f00d21..eb03e9dbed 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -553,10 +553,10 @@ optional whitespace. The value of an _option_ can be either a _literal_ or a _variable_. Multiple _options_ are permitted in an _annotation_. -Each _option_ is separated by whitespace. - -The _option_ _identifiers_ MUST be unique within each _expression_. -Otherwise, the _message_ is not considered _valid_. +_Options_ are separated from other parts of the _annotation_ +and from each other by whitespace. +Each _option_'s _identifier_ MUST be unique within the _annotation_: +an _annotation_ with duplicate _option_ _identifiers_ is not valid. ```abnf option = identifier [s] "=" [s] (literal / variable) From e6ee084f72a2e2db5ce261f4a675eb8f8f1bbe66 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Tue, 2 Jan 2024 11:49:49 -0800 Subject: [PATCH 3/3] Update spec/syntax.md Good callout 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 eb03e9dbed..a62848135c 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -553,7 +553,7 @@ optional whitespace. The value of an _option_ can be either a _literal_ or a _variable_. Multiple _options_ are permitted in an _annotation_. -_Options_ are separated from other parts of the _annotation_ +_Options_ are separated from the preceding _function_ _identifier_ and from each other by whitespace. Each _option_'s _identifier_ MUST be unique within the _annotation_: an _annotation_ with duplicate _option_ _identifiers_ is not valid.