diff options
Diffstat (limited to 'bootstrap')
| -rw-r--r-- | bootstrap/test2.cff | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff index 0c546bb..f5dec29 100644 --- a/bootstrap/test2.cff +++ b/bootstrap/test2.cff @@ -45,5 +45,50 @@ extern fn main() void { x = X + 1 + Y; let const v= Value:None; - v = :Int(1 + x); + switch v { + case None; + case Int i; + i; + case Flo *f; + let x f32 = *f; + } + let t = v.#tag; + let i = v.Int; + // v.#tag++; + + #'outer for let i = 0; i++ < 10; { + printf("%d\n", i); + while #t { + if i < 2 { + continue #'outer; + } + break #'outer; + } + } + + let x = Option<f32>:None; + let x = Option<int>:Some(42); + switch (do x;) { + case None; + printf("x empty\n"); + case Some i; + printf("x by value %d\n", i); + } + switch x { + case None; + printf("x empty\n"); + case Some *i; + printf("x by ptr %d\n", *i); + } + + printf("n %d\n", n.value); + printf("n link %d\n", n.link.value); + + let x Node<f32> = {}; + n->ok(); + x->ok(); + + Bit<i32>:foo(3); + Bit<i64>:foo(3); } + |