Small speed improvement int trim by using stack (and DFS) instead of queue (and BFS) for remove and collapse, finally fix the unknown escape '\*' error

This commit is contained in:
Nathan Braswell
2017-01-25 01:47:05 -05:00
parent 987e6eb9a5
commit caba8b310f
4 changed files with 12 additions and 4 deletions

View File

@@ -196,7 +196,7 @@ fun get_builtin_function(name: string, param_types: vector<*type>, syntax: *tree
}
if (name == "&" && param_types.size == 1)
return ast_function_ptr(name, type_ptr(param_types, param_types[0]->clone_with_increased_indirection()), vector<*ast_node>(), false)
if (name == "\*" && param_types.size == 1) {
if (name == "*" && param_types.size == 1) {
if (param_types[0]->indirection == 0)
error(syntax, string("drereferencing not a pointer: ") + name)
else