Fix case_statement/lambda-close-over-variables bug, rename ast_node file to make ast_node:: unambigious, change test_ast to test_compiler and add a little skeleton c_generator file
This commit is contained in:
@@ -1070,6 +1070,12 @@ std::set<NodeTree<ASTData>*> ASTTransformation::findVariablesToClose(NodeTree<AS
|
||||
}
|
||||
return closed;
|
||||
}
|
||||
if (stat->getDataRef()->type == case_statement) {
|
||||
// don't try to close over the variant specifier itself, only its statement child
|
||||
auto recClosed = findVariablesToClose(func, stat->getChildren().back(), scope);
|
||||
closed.insert(recClosed.begin(), recClosed.end());
|
||||
return closed;
|
||||
}
|
||||
if (stat->getDataRef()->type == function_call && (stat->getDataRef()->symbol.getName() == "." || stat->getDataRef()->symbol.getName() == "->")) {
|
||||
// only search on the left side of access operators like . and ->
|
||||
auto recClosed = findVariablesToClose(func, stat->getChildren()[1], scope);
|
||||
|
||||
Reference in New Issue
Block a user