ref_lower now generates C, though a ton of syntax errors

This commit is contained in:
Nathan Braswell
2017-01-20 01:11:06 -05:00
parent b0d2a6918d
commit e2639989c9
16 changed files with 345 additions and 56 deletions

View File

@@ -13,6 +13,7 @@ import pass_common:*
fun defer_lower(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_to_syntax: *map<*ast_node, *tree<symbol>>) {
var enclosing_function = null<ast_node>()
var visited = set<*ast_node>()
name_ast_map->for_each(fun(name: string, syntax_ast_pair: pair<*tree<symbol>,*ast_node>) {
var defer_double_stack = stack<stack<*ast_node>>()
var loop_stack = stack(-1)
@@ -79,7 +80,7 @@ fun defer_lower(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_t
}
}
}
run_on_tree(helper_before, helper_after, syntax_ast_pair.second)
run_on_tree(helper_before, helper_after, syntax_ast_pair.second, &visited)
})
}