Fix braces handling when parsing method arguments on project conversion

This commit is contained in:
Garym3 2023-06-19 22:46:42 +02:00 committed by Garym
parent 013a457068
commit 4aecba68e3

View file

@ -1217,14 +1217,17 @@ Vector<String> 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<String> 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) {