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 interpreter:*
import pass_common:*
fun ctce_lower(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_to_syntax: *map<*ast_node, *tree<symbol>>) {
var visited = set<*ast_node>()
var globals = setup_globals(*name_ast_map)
var ctce_passes = vector<*ast_node>()
name_ast_map->for_each(fun(name: string, syntax_ast_pair: pair<*tree<symbol>,*ast_node>) {
@@ -29,7 +30,7 @@ fun ctce_lower(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_to
}
}
}
run_on_tree(helper_before, empty_pass_second_half, syntax_ast_pair.second)
run_on_tree(helper_before, empty_pass_second_half, syntax_ast_pair.second, &visited)
})
ctce_passes.for_each(fun(func: *ast_node) {
// don't want to pick up the ast_node::value