Basic AST

This commit is contained in:
Nathan Braswell
2018-06-18 19:04:24 -04:00
parent e898e7b285
commit b5ce776726
6 changed files with 274 additions and 9 deletions

View File

@@ -9,6 +9,11 @@ obj tree<T> (Object) {
children.construct()
return this
}
fun construct(dataIn: T, c: ref vec::vec<*tree<T>>): *tree<T> {
mem::maybe_copy_construct(&data, &dataIn)
children.copy_construct(&c)
return this
}
// Some of these don't really make much sense considering this tree is all about
// heap allocated pointers. Best to have it for saftey, though
fun copy_construct(old: *tree<T>) {