apply empty brackets removal until full fix
This commit is contained in:
@@ -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)
|
static void process_remove_empty_brackets(std::vector<Expression::Token>& tv)
|
||||||
{
|
{
|
||||||
pr_debug("Pre-process: remove empty brackets");
|
pr_debug("Pre-process: remove empty brackets");
|
||||||
|
|
||||||
|
int fix = -1;
|
||||||
|
while (fix) {
|
||||||
|
fix = 0;
|
||||||
|
|
||||||
for (int i = 0; i < tv.size() - 1; i++)
|
for (int i = 0; i < tv.size() - 1; i++)
|
||||||
{
|
{
|
||||||
if (tv[i].t == Expression::Token::OPERATOR
|
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);
|
tv.erase(tv.begin() + i, tv.begin() + i + 2);
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
|
fix++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user