Some speed improvements

This commit is contained in:
Nathan Braswell
2016-06-11 00:45:18 -07:00
parent 59969e7114
commit 2c8c3af48a
9 changed files with 85 additions and 65 deletions

View File

@@ -1263,7 +1263,7 @@ fun function_lookup(name: string, scope: *ast_node, param_types: vector<*type>):
/*println(string("function lookup failed for ") + name)*/
return null<ast_node>()
}
fun identifier_lookup(name: string, scope: *ast_node): *ast_node {
fun identifier_lookup(name: ref string, scope: *ast_node): *ast_node {
/*println(string("doing identifier lookup for: ") + name)*/
var results = scope_lookup(name, scope)
if (!results.size) {
@@ -1272,7 +1272,7 @@ fun identifier_lookup(name: string, scope: *ast_node): *ast_node {
}
return results[0]
}
fun scope_lookup(name: string, scope: *ast_node): vector<*ast_node> {
fun scope_lookup(name: ref string, scope: *ast_node): vector<*ast_node> {
// println("*****Doing a name lookup for*****")
// println(name)
var results = vector(scope)
@@ -1291,7 +1291,7 @@ fun scope_lookup(name: string, scope: *ast_node): vector<*ast_node> {
})
return results
}
fun scope_lookup_helper(name: string, scope: *ast_node, visited: set<*ast_node>): vector<*ast_node> {
fun scope_lookup_helper(name: ref string, scope: *ast_node, visited: set<*ast_node>): vector<*ast_node> {
// need to do properly scopded lookups
// print("scope is: ")
// get_ast_scope(scope)->for_each(fun(key: string, value: vector<*ast_node>) print(key + " ");)