Format with clang

This commit is contained in:
wingphil
2025-03-07 17:08:05 +00:00
parent 9874ecde82
commit a6f77250b5
3 changed files with 30 additions and 28 deletions

View File

@@ -630,12 +630,15 @@ void skipBrackets(const std::string & expr, size_t & pos, const int direction) {
int i = pos; int i = pos;
char open = '(', close = ')'; char open = '(', close = ')';
if (direction == -1) { if (direction == -1) {
open = ')'; close = '('; open = ')';
close = '(';
} }
size_t depth = 1; size_t depth = 1;
while ((i >= 0) && (i < expr.size()) && depth > 0) { while ((i >= 0) && (i < expr.size()) && depth > 0) {
if (expr[i] == open) depth++; if (expr[i] == open)
if (expr[i] == close) depth--; depth++;
if (expr[i] == close)
depth--;
i += direction; i += direction;
} }
if (depth > 0) { if (depth > 0) {
@@ -644,7 +647,6 @@ void skipBrackets(const std::string & expr, size_t & pos, const int direction) {
} else { } else {
pos = i - direction * 2; pos = i - direction * 2;
} }
} }
// check for multiple instances of <cond> ? <expr1> : <expr2> // check for multiple instances of <cond> ? <expr1> : <expr2>