From 4aecba68e347a31943dd864a5cb4b8628f351665 Mon Sep 17 00:00:00 2001 From: Garym3 Date: Mon, 19 Jun 2023 22:46:42 +0200 Subject: [PATCH] Fix braces handling when parsing method arguments on project conversion --- editor/project_converter_3_to_4.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index a1dfbac719f..bddb19ac029 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -1217,14 +1217,17 @@ Vector ProjectConverter3To4::parse_arguments(const String &line) { for (int current_index = 0; current_index < string_size; current_index++) { char32_t character = line.get(current_index); switch (character) { - case '(': { + case '(': + case '[': + case '{': { parts_counter++; if (parts_counter == 1 && !is_inside_string) { start_part = current_index; } break; }; - case ')': { + case ')': + case '}': { parts_counter--; if (parts_counter == 0 && !is_inside_string) { parts.append(line.substr(start_part + 1, current_index - start_part - 1)); @@ -1232,13 +1235,6 @@ Vector ProjectConverter3To4::parse_arguments(const String &line) { } break; }; - case '[': { - parts_counter++; - if (parts_counter == 1 && !is_inside_string) { - start_part = current_index; - } - break; - }; case ']': { parts_counter--; if (parts_counter == 0 && !is_inside_string) {