You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
GDScript: Implement pattern guards for match statement
Within a match statement, it is now possible to add guards in each
branch:
var a = 0
match a:
0 when false: print("does not run")
0 when true: print("but this does")
This allows more complex logic for deciding which branch to take.
This commit is contained in:
@@ -948,6 +948,7 @@ public:
|
||||
Vector<PatternNode *> patterns;
|
||||
SuiteNode *block = nullptr;
|
||||
bool has_wildcard = false;
|
||||
SuiteNode *guard_body = nullptr;
|
||||
|
||||
MatchBranchNode() {
|
||||
type = MATCH_BRANCH;
|
||||
|
||||
Reference in New Issue
Block a user