From 5e73fad2e1f5a57c5639ac9fb9d8369c07cdb209 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 24 Jul 2023 12:54:30 -0700 Subject: [PATCH 1/4] Add details to "Missing Selector Annotation error" section: * Clarify explanation of error * Add valid examples * Move one of the invalid examples to the "valid" section" --- spec/formatting.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/spec/formatting.md b/spec/formatting.md index e3c7cefcf3..035cf37e22 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -677,8 +677,8 @@ These are divided into the following categories: > ``` - A **_Missing Selector Annotation error_** is an error that occurs when the _message_ - contains a _selector_ that does not have an _annotation_, - or contains a _variable_ that does not directly or indirectly reference a _declaration_ with an _annotation_. + contains a _selector_ that does not directly or indirectly reference + an _expression_ with an _annotation_. > Example invalid messages resulting in a _Missing Selector Annotation error_: > @@ -695,6 +695,15 @@ These are divided into the following categories: > when * {Value is not one} > ``` > + > Example **valid** messages that do _not_ result in a _Missing Selector Annotation error_: + > + > + > ``` + > match {$two :func} + > when 1 {Value is one} + > when * {Value is not one} + > ``` + > > ``` > let $one = {|The one| :func} > let $two = {$one} @@ -702,7 +711,10 @@ These are divided into the following categories: > when 1 {Value is one} > when * {Value is not one} > ``` - + > + > The second message is valid because `$two` refers to the expression `$one`, + > and `$one` refers to the expression ` {|The one| :func}`, which has an annotation. + - **Duplicate Option Name errors** occur when the same _name_ appears on the left-hand side of more than one _option_ in the same _expression_. From a9427ca170005d2753042c342d429b6ee3df52a7 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 24 Jul 2023 13:25:56 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Eemeli Aro --- spec/formatting.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spec/formatting.md b/spec/formatting.md index 035cf37e22..baba3786b1 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -695,7 +695,7 @@ These are divided into the following categories: > when * {Value is not one} > ``` > - > Example **valid** messages that do _not_ result in a _Missing Selector Annotation error_: + > Example valid messages that do not result in a _Missing Selector Annotation error_: > > > ``` @@ -711,9 +711,6 @@ These are divided into the following categories: > when 1 {Value is one} > when * {Value is not one} > ``` - > - > The second message is valid because `$two` refers to the expression `$one`, - > and `$one` refers to the expression ` {|The one| :func}`, which has an annotation. - **Duplicate Option Name errors** occur when the same _name_ appears on the left-hand side From 65bded4faec83c13c20a2113cc223ef6a286df27 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 24 Jul 2023 12:54:30 -0700 Subject: [PATCH 3/4] Add details to "Missing Selector Annotation error" section: * Clarify explanation of error * Add valid examples * Move one of the invalid examples to the "valid" section" --- spec/formatting.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/spec/formatting.md b/spec/formatting.md index baba3786b1..e50ffe7126 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -695,24 +695,8 @@ These are divided into the following categories: > when * {Value is not one} > ``` > - > Example valid messages that do not result in a _Missing Selector Annotation error_: - > - > - > ``` - > match {$two :func} - > when 1 {Value is one} - > when * {Value is not one} - > ``` - > - > ``` - > let $one = {|The one| :func} - > let $two = {$one} - > match {$two} - > when 1 {Value is one} - > when * {Value is not one} - > ``` - - - **Duplicate Option Name errors** occur when the same _name_ + +- **Duplicate Option Name errors** occur when the same _name_ appears on the left-hand side of more than one _option_ in the same _expression_. From 3f4e63fbc8c8159daffc2964f71cff1bab62ed3b Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 26 Jul 2023 23:39:33 -0700 Subject: [PATCH 4/4] Re-word 'Missing Selector Annotation error' section and remove valid examples --- spec/formatting.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/formatting.md b/spec/formatting.md index e50ffe7126..a96158abc4 100644 --- a/spec/formatting.md +++ b/spec/formatting.md @@ -677,8 +677,14 @@ These are divided into the following categories: > ``` - A **_Missing Selector Annotation error_** is an error that occurs when the _message_ - contains a _selector_ that does not directly or indirectly reference - an _expression_ with an _annotation_. + contains a _selector_ without an _annotation_. + + An implementation MUST NOT emit this error for a _selector_ _expression_ + that would have an _annotation_ + if each local _variable_ in it were replaced + with the _expression_ of its binding _declaration_, + repeating this process until the _expression_ + contains no local _variable_s. > Example invalid messages resulting in a _Missing Selector Annotation error_: >