Rewrite check for loops for break/continue under varying CF to use WalkAST()

This commit is contained in:
Matt Pharr
2011-12-16 10:44:37 -08:00
parent 45767ad197
commit 34eda04d9b
3 changed files with 125 additions and 20 deletions

View File

@@ -75,8 +75,11 @@ WalkAST(ASTNode *node, ASTCallBackFunc preFunc, ASTCallBackFunc postFunc,
return;
// Call the callback function
if (preFunc != NULL)
preFunc(node, data);
if (preFunc != NULL) {
if (preFunc(node, data) == false)
// The function asked us to not continue recursively, so stop.
return;
}
////////////////////////////////////////////////////////////////////////////
// Handle Statements