aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-01-29 20:14:51 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-01-29 20:14:51 +0100
commit5df50ecccae28fc41461637b7bde1cdb383da30e (patch)
treeeba9303027573971e2d2902485177b6016ea7f83
parentc16f77289248633fb3229877e33e5e68dd27a826 (diff)
downloadsylt-5df50ecccae28fc41461637b7bde1cdb383da30e.tar.gz
blobs in blobs
-rw-r--r--TODO1
-rw-r--r--src/vm.rs4
-rw-r--r--tests/simple.tdy10
3 files changed, 8 insertions, 7 deletions
diff --git a/TODO b/TODO
index e8657bf..84e970d 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,4 @@
PONG
-- structs in structs
- foreign function
- constructors? ({.x = }-ish)
- foreign structs
diff --git a/src/vm.rs b/src/vm.rs
index 2b5b2bf..0fb38ea 100644
--- a/src/vm.rs
+++ b/src/vm.rs
@@ -596,10 +596,6 @@ impl VM {
values.push(Value::Nil);
}
- for (slot, ty) in blob.name_to_field.values() {
- values[*slot] = ty.as_value();
- }
-
self.stack.pop();
self.stack.push(Value::BlobInstance(blob_id, Rc::new(RefCell::new(values))));
}
diff --git a/tests/simple.tdy b/tests/simple.tdy
index de6841b..7ecac8b 100644
--- a/tests/simple.tdy
+++ b/tests/simple.tdy
@@ -1,18 +1,24 @@
+blob B {
+ a: int
+}
+
blob A {
a: int
- b: int
+ b: B
c: float
}
hello : fn A -> = fn a: A {
print a.a
print a.b
+ print a.b.a
print a.c
}
a := A()
a.a = 1
-a.b = 2
+a.b = B()
+a.b.a = 2
a.c = 3.
hello(a)