mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 17:41:19 +00:00
Fix issues with multiple bind patterns in match statement
This commit is contained in:
parent
c630c2001d
commit
3c5b9d1be3
5 changed files with 18 additions and 1 deletions
|
|
@ -1863,7 +1863,7 @@ GDScriptParser::MatchBranchNode *GDScriptParser::parse_match_branch() {
|
|||
if (pattern == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (pattern->pattern_type == PatternNode::PT_BIND) {
|
||||
if (pattern->binds.size() > 0) {
|
||||
has_bind = true;
|
||||
}
|
||||
if (branch->patterns.size() > 0 && has_bind) {
|
||||
|
|
@ -1899,6 +1899,7 @@ GDScriptParser::MatchBranchNode *GDScriptParser::parse_match_branch() {
|
|||
|
||||
for (const StringName &E : binds) {
|
||||
SuiteNode::Local local(branch->patterns[0]->binds[E], current_function);
|
||||
local.type = SuiteNode::Local::PATTERN_BIND;
|
||||
suite->add_local(local);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue