From f515a06e3e75075536ea9ead872e37b32549f6e1 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 10 Feb 2025 12:02:25 -0800 Subject: [PATCH 1/3] Add a note about representing the string `*` in a key This addresses the problem by spelling out the difference between `|*|` and `*` in keys. --- spec/syntax.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/syntax.md b/spec/syntax.md index 85db09d40f..569cfd7d32 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -461,6 +461,15 @@ A _key_ can be either a _literal_ value or the "catch-all" key `*`. The **_catch-all key_** is a special key, represented by `*`, that matches all values for a given _selector_. +> [!NOTE] +> To represent a key_ consisting of the character `*` U+002A ASTERISK, +> use a quoted literal: +> ``` +> .match $value +> |*| {{Matches the string *}} +> * {{Matches any other string}} +> ``` + The value of each _literal_ _key_ MUST be treated as if it were in [Unicode Normalization Form C](https://unicode.org/reports/tr15/) ("NFC"). Two _literal_ _keys_ are considered equal if they are canonically equivalent strings, From 5e9aea1bb880d7f1d7e7ecac2a5c7c07956fa70c Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 10 Feb 2025 12:03:53 -0800 Subject: [PATCH 2/3] Fix typo --- spec/syntax.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/syntax.md b/spec/syntax.md index 569cfd7d32..7843d428a3 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -462,8 +462,8 @@ The **_catch-all key_** is a special key, represented by `*`, that matches all values for a given _selector_. > [!NOTE] -> To represent a key_ consisting of the character `*` U+002A ASTERISK, -> use a quoted literal: +> To represent a _key_ consisting of the character `*` U+002A ASTERISK, +> use a _quoted literal_: > ``` > .match $value > |*| {{Matches the string *}} From a1d5abaa410f9a738ebf654e877c59ec7cddff23 Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 10 Feb 2025 16:34:05 -0800 Subject: [PATCH 3/3] Update spec/syntax.md Co-authored-by: Eemeli Aro --- spec/syntax.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/syntax.md b/spec/syntax.md index 7843d428a3..9e1411f9d8 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -465,6 +465,7 @@ that matches all values for a given _selector_. > To represent a _key_ consisting of the character `*` U+002A ASTERISK, > use a _quoted literal_: > ``` +> .input {$value :string} > .match $value > |*| {{Matches the string *}} > * {{Matches any other string}}