From cbed5a14aa8c1624f6f350d92c1de0c9ef55e40c Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 8 Aug 2022 05:33:56 +0200 Subject: basic pattern matching --- bootstrap/test2.cff | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bootstrap/test2.cff') diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff index e5e484a..4690f72 100644 --- a/bootstrap/test2.cff +++ b/bootstrap/test2.cff @@ -31,8 +31,13 @@ extern fn main() void { let x int #?; x = X + 1 + Y; - let v Value = :None; + let v= Value:None; v = :Int 3; + switch (v) { + case None; + case Int i; + i; + } printf("n %d\n", n.value); printf("n link %d\n", n.link.value); -- cgit v1.2.3