apply empty brackets removal until full fix

This commit is contained in:
2026-10-14 21:18:27 +03:00
parent f430b3616a
commit 1a258cd051
+8
View File
@@ -792,6 +792,11 @@ static void remove_extra_brackets(std::vector<Expression::Token>& tv)
static void process_remove_empty_brackets(std::vector<Expression::Token>& tv)
{
pr_debug("Pre-process: remove empty brackets");
int fix = -1;
while (fix) {
fix = 0;
for (int i = 0; i < tv.size() - 1; i++)
{
if (tv[i].t == Expression::Token::OPERATOR
@@ -806,6 +811,9 @@ static void process_remove_empty_brackets(std::vector<Expression::Token>& tv)
tv.erase(tv.begin() + i, tv.begin() + i + 2);
i--;
fix++;
}
}
}
}