astyle formatting
This commit is contained in:
parent
b74618d989
commit
ed05a5c3b3
|
@ -74,9 +74,13 @@ struct ForwardTraversal {
|
||||||
return std::make_pair(checkThen, checkElse);
|
return std::make_pair(checkThen, checkElse);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isConditionTrue(const Token* tok, const Token* ctx = nullptr) const { return evalCond(tok, ctx).first; }
|
bool isConditionTrue(const Token* tok, const Token* ctx = nullptr) const {
|
||||||
|
return evalCond(tok, ctx).first;
|
||||||
|
}
|
||||||
|
|
||||||
bool isConditionFalse(const Token* tok, const Token* ctx = nullptr) const { return evalCond(tok, ctx).second; }
|
bool isConditionFalse(const Token* tok, const Token* ctx = nullptr) const {
|
||||||
|
return evalCond(tok, ctx).second;
|
||||||
|
}
|
||||||
|
|
||||||
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*>)>
|
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*>)>
|
||||||
Progress traverseTok(T* tok, std::function<Progress(T*)> f, bool traverseUnknown, T** out = nullptr) {
|
Progress traverseTok(T* tok, std::function<Progress(T*)> f, bool traverseUnknown, T** out = nullptr) {
|
||||||
|
@ -252,8 +256,7 @@ struct ForwardTraversal {
|
||||||
return std::vector<ForwardTraversal> {};
|
return std::vector<ForwardTraversal> {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ForwardTraversal> tryForkUpdateScope(Token* endBlock, bool isModified = false)
|
std::vector<ForwardTraversal> tryForkUpdateScope(Token* endBlock, bool isModified = false) {
|
||||||
{
|
|
||||||
std::vector<ForwardTraversal> result = tryForkScope(endBlock, isModified);
|
std::vector<ForwardTraversal> result = tryForkScope(endBlock, isModified);
|
||||||
for (ForwardTraversal& ft : result)
|
for (ForwardTraversal& ft : result)
|
||||||
ft.updateScope(endBlock);
|
ft.updateScope(endBlock);
|
||||||
|
@ -346,7 +349,9 @@ struct ForwardTraversal {
|
||||||
changed |= isExpressionChanged(condTok, endBlock->link(), endBlock, settings, true);
|
changed |= isExpressionChanged(condTok, endBlock->link(), endBlock, settings, true);
|
||||||
// Check for mutation in the condition
|
// Check for mutation in the condition
|
||||||
changed |= nullptr !=
|
changed |= nullptr !=
|
||||||
findAstNode(condTok, [&](const Token* tok) { return isVariableChanged(tok, 0, settings, true); });
|
findAstNode(condTok, [&](const Token* tok) {
|
||||||
|
return isVariableChanged(tok, 0, settings, true);
|
||||||
|
});
|
||||||
if (!changed)
|
if (!changed)
|
||||||
return true;
|
return true;
|
||||||
ForwardTraversal ft = fork(true);
|
ForwardTraversal ft = fork(true);
|
||||||
|
|
Loading…
Reference in New Issue