1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

GDScript: Remove function of continue for match statement

The keyword is confusing and rarely is used in the intended way. It is
removed now in favor of a future feature (pattern guards) to avoid
breaking compatibility later.
This commit is contained in:
George Marques
2023-01-21 13:33:05 -03:00
parent 2ec0da1a75
commit 9462ae4783
10 changed files with 5 additions and 76 deletions

View File

@@ -1543,28 +1543,6 @@ void GDScriptByteCodeGenerator::write_endwhile() {
current_breaks_to_patch.pop_back();
}
void GDScriptByteCodeGenerator::start_match() {
match_continues_to_patch.push_back(List<int>());
}
void GDScriptByteCodeGenerator::start_match_branch() {
// Patch continue statements.
for (const int &E : match_continues_to_patch.back()->get()) {
patch_jump(E);
}
match_continues_to_patch.pop_back();
// Start a new list for next branch.
match_continues_to_patch.push_back(List<int>());
}
void GDScriptByteCodeGenerator::end_match() {
// Patch continue statements.
for (const int &E : match_continues_to_patch.back()->get()) {
patch_jump(E);
}
match_continues_to_patch.pop_back();
}
void GDScriptByteCodeGenerator::write_break() {
append_opcode(GDScriptFunction::OPCODE_JUMP);
current_breaks_to_patch.back()->get().push_back(opcodes.size());
@@ -1576,12 +1554,6 @@ void GDScriptByteCodeGenerator::write_continue() {
append(continue_addrs.back()->get());
}
void GDScriptByteCodeGenerator::write_continue_match() {
append_opcode(GDScriptFunction::OPCODE_JUMP);
match_continues_to_patch.back()->get().push_back(opcodes.size());
append(0);
}
void GDScriptByteCodeGenerator::write_breakpoint() {
append_opcode(GDScriptFunction::OPCODE_BREAKPOINT);
}