Add integer select pattern
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
2b7323eaf0
commit
e6473f64ae
5 changed files with 466 additions and 373 deletions
|
|
@ -409,6 +409,46 @@ foo = select(some_boolean("IS_TRUE"), {
|
|||
(boolean_literal))
|
||||
(interpreted_string_literal))))))
|
||||
|
||||
================================================================================
|
||||
Select (integer typed)
|
||||
================================================================================
|
||||
|
||||
foo = select(some_integer("VALUE"), {
|
||||
0: "0",
|
||||
-1: "-1",
|
||||
1: "1",
|
||||
default: "default",
|
||||
})
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(operator)
|
||||
(select_expression
|
||||
(select_value
|
||||
(condition
|
||||
(identifier)
|
||||
(interpreted_string_literal)))
|
||||
(select_cases
|
||||
(select_case
|
||||
(select_pattern
|
||||
(integer_literal))
|
||||
(interpreted_string_literal))
|
||||
(select_case
|
||||
(select_pattern
|
||||
(integer_literal))
|
||||
(interpreted_string_literal))
|
||||
(select_case
|
||||
(select_pattern
|
||||
(integer_literal))
|
||||
(interpreted_string_literal))
|
||||
(select_case
|
||||
(select_pattern
|
||||
(default))
|
||||
(interpreted_string_literal))))))
|
||||
|
||||
================================================================================
|
||||
Select as an identifier
|
||||
================================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue