import "libc.hff"; struct Node { link *Node, value T, fn ok(self Node) void { } } struct Array { m [N]T, } def X = 7 + 2; struct Bit { def Z = 3; fn foo(x T) T { return (~x ^ X) + Z; } // fn foo(x T) T { return ~x + Y; } } defmacro def2(x, v) [static x = (v)] def2(Y, 3.3); enum union Value { None, Int i32, Flo f32, } enum union Option { None, Some T } extern fn main() void { let n Node = {#null, 0}; let n Node = {&n, 1}; let x Array = {}; let x Array = x; let x int #?; x = X + 1 + Y; let const v= Value:None; 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:None; let x = Option: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 li" "nk %d\n", n.link.value); let x Node = {}; n->ok(); x->ok(); Bit:foo(3); Bit:foo(3); }