virtualx-engine/modules/gdscript/tests/scripts/parser/features/match_array.gd

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
521 B
GDScript3
Raw Normal View History

func foo(x):
match x:
["value1"]:
print('["value1"]')
["value1", "value2"]:
print('["value1", "value2"]')
func bar(x):
match x:
[
"value1"
]:
print('multiline ["value1"]')
[
"value1",
"value2",
]:
print('multiline ["value1", "value2",]')
[
"value1",
[
"value2",
..,
],
]:
print('multiline ["value1", ["value2", ..,],]')
func test():
foo(["value1"])
foo(["value1", "value2"])
bar(["value1"])
bar(["value1", "value2"])
bar(["value1", ["value2", "value3"]])