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:
Nathan Braswell
2016-01-04 00:38:59 -05:00
parent 21a7afe66d
commit 84032eece0
7 changed files with 95 additions and 12 deletions

View File

@@ -36,11 +36,13 @@ NodeTree<T>* RemovalTransformation<T>::transform(NodeTree<T>* from) {
while(!toProcess.empty()) {
NodeTree<T>* node = toProcess.front();
toProcess.pop();
if (!node)
continue;
std::vector<NodeTree<T>*> children = node->getChildren();
for (int i = 0; i < children.size(); i++) {
if (children[i]->getData() == toRemove)
node->removeChild(children[i]);
else
else if (children[i])
toProcess.push(children[i]);
}
}