Optional dot syntax for anchored keys (#423)

This commit is contained in:
Andrew Twyman 2025-09-11 12:23:46 -07:00 committed by GitHub
parent f95a27b412
commit 7e04eb51ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 18 deletions

View file

@ -54,8 +54,11 @@ statement_arg_list = { statement_arg ~ ("," ~ statement_arg)* }
statement = { identifier ~ "(" ~ statement_arg_list? ~ ")" }
// Anchored Key: ?Var["key_literal"]
anchored_key = { wildcard ~ "[" ~ literal_string ~ "]" }
// Anchored Key: ?Var["key_literal"] or ?Var.key_identifier
anchored_key = {
(wildcard ~ "[" ~ literal_string ~ "]")
| (wildcard ~ "." ~ identifier)
}
// Literal Values (ordered to avoid ambiguity, e.g., string before int)
literal_value = {