Skip to content

Commit 69c289c

Browse files
committed
Add support for conditional expressions in match statements
Close #33
1 parent 756bce7 commit 69c289c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

tests/expected/match_case.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ func foo():
1010
_:
1111
pass
1212
match 0:
13+
# Warnings and comments should be preserved
1314
@warning_ignore("unreachable_pattern")
1415
0 when true:
1516
print("true")
17+
match 5:
18+
# Conditional expression should be supported
19+
0 if true else 2:
20+
pass

tests/input/match_case.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ func foo():
1010
_ :
1111
pass
1212
match 0:
13+
# Warnings and comments should be preserved
1314
@warning_ignore("unreachable_pattern")
1415
0 when true:
1516
print("true")
17+
match 5:
18+
# Conditional expression should be supported
19+
0 if true else 2:
20+
pass

0 commit comments

Comments
 (0)