Merge pull request #80085 from vnen/gdscript-pattern-guards

GDScript: Implement pattern guards for match statement
This commit is contained in:
Yuri Sizov 2023-09-28 20:03:57 +02:00
commit 813cd1dfc8
15 changed files with 163 additions and 1 deletions

View file

@ -0,0 +1,5 @@
func test():
var a = 0
match a:
0 when a = 1:
print("assignment not allowed on pattern guard")

View file

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Assignment is not allowed inside an expression.

View file

@ -14,3 +14,7 @@ func test():
var TAU = "TAU"
print(TAU)
# New keyword for pattern guards.
var when = "when"
print(when)