Pattern matching in X86

This commit is contained in:
Dmitry Boulytchev 2018-05-16 16:50:36 +03:00
parent 1f1ef2ce57
commit 57588f2605
18 changed files with 179 additions and 3 deletions

17
regression/test042.expr Normal file
View file

@ -0,0 +1,17 @@
fun f (x) {
case x of
`nil -> write (0)
| `cons (_, `nil) -> write (1)
| `cons (_, `cons (_, `nil)) -> write (2)
| `cons (_, `cons (_, `cons (_, `nil))) -> write (3)
| _ -> write (4)
esac
}
x := read ();
y := `nil;
for i := 0, i < 10, i := i + 1 do
f (y);
y := `cons (i, y)
od