Template functions (instantiated implicitly) work!

This commit is contained in:
Nathan Braswell
2018-10-09 23:00:57 -04:00
parent 39ecf24e69
commit 379d9f612e
6 changed files with 91 additions and 47 deletions

View File

@@ -274,6 +274,15 @@ fun set_ast_binding(binding: *tree<ast>, to: *tree<ast>) {
}
error("trying to set binding on not a binding")
}
fun set_single_ast_binding(binding: *tree<ast>, to: *tree<ast>) {
match(binding->data) {
ast::_binding(b) {
b.third->set_single(to)
return
}
}
error("trying to set binding on not a binding")
}
fun ast_bound(binding: *tree<ast>): bool {
match(binding->data) {
ast::_binding(b) return b.third->bound()