Merge pull request #74567 from Garym3/3-to-4-converter-brace-aggregate-fix

Fix braces handling when parsing method arguments on project conversion
This commit is contained in:
Rémi Verschelde 2023-06-20 09:19:33 +02:00
commit 49dedd6ce4
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1274,14 +1274,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));
@ -1289,13 +1292,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) {