Allow optional trailing comma in 'select'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This commit is contained in:
parent
fd92a31674
commit
aeb1fc2bb5
|
@ -145,7 +145,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
select_cases: ($) => seq(
|
select_cases: ($) => seq(
|
||||||
"{",
|
"{",
|
||||||
optional(commaSeparatedTrailing($.select_case)),
|
optional(commaSeparatedOptTrailing($.select_case)),
|
||||||
"}",
|
"}",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
25
src/grammar.json
generated
25
src/grammar.json
generated
|
@ -614,21 +614,42 @@
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "REPEAT",
|
|
||||||
"content": {
|
|
||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "select_case"
|
"name": "select_case"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "REPEAT",
|
||||||
|
"content": {
|
||||||
|
"type": "SEQ",
|
||||||
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ","
|
"value": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "select_case"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "STRING",
|
||||||
|
"value": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "BLANK"
|
"type": "BLANK"
|
||||||
}
|
}
|
||||||
|
|
2488
src/parser.c
generated
2488
src/parser.c
generated
File diff suppressed because it is too large
Load diff
|
@ -33,6 +33,31 @@ foo = select(release_variable("RELEASE_TEST"), {
|
||||||
(default))
|
(default))
|
||||||
(unset))))))
|
(unset))))))
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
Select (no trailing comma)
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
foo = select(release_variable("RELEASE_TEST"), {
|
||||||
|
default: unset
|
||||||
|
})
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(source_file
|
||||||
|
(assignment
|
||||||
|
(identifier)
|
||||||
|
(operator)
|
||||||
|
(select_expression
|
||||||
|
(select_value
|
||||||
|
(condition
|
||||||
|
(identifier)
|
||||||
|
(interpreted_string_literal)))
|
||||||
|
(select_cases
|
||||||
|
(select_case
|
||||||
|
(select_pattern
|
||||||
|
(default))
|
||||||
|
(unset))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Select (soong config variable)
|
Select (soong config variable)
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
Loading…
Reference in a new issue