Add 'any' select pattern

This commit is contained in:
Bruno BELANYI 2024-07-01 13:46:22 +00:00
parent 2326d709fb
commit 970241b323
5 changed files with 981 additions and 916 deletions

View file

@ -163,6 +163,7 @@ module.exports = grammar({
_select_pattern: ($) => choice(
$._string_literal,
$.boolean_literal,
alias("any", $.any),
alias("default", $.default),
),

9
src/grammar.json generated
View file

@ -735,6 +735,15 @@
"type": "SYMBOL",
"name": "boolean_literal"
},
{
"type": "ALIAS",
"content": {
"type": "STRING",
"value": "any"
},
"named": true,
"value": "any"
},
{
"type": "ALIAS",
"content": {

8
src/node-types.json generated
View file

@ -483,6 +483,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "any",
"named": true
},
{
"type": "boolean_literal",
"named": true
@ -584,6 +588,10 @@
"type": "]",
"named": false
},
{
"type": "any",
"named": true
},
{
"type": "default",
"named": true

1874
src/parser.c generated

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@ Select
foo = select(release_variable("RELEASE_TEST"), {
"d": "d2",
any: unset,
default: unset,
})
@ -23,6 +24,10 @@ foo = select(release_variable("RELEASE_TEST"), {
(select_pattern
(interpreted_string_literal))
(interpreted_string_literal))
(select_case
(select_pattern
(any))
(unset))
(select_case
(select_pattern
(default))