mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-27 09:08:48 +00:00
'as' pattern
This commit is contained in:
parent
be89ee983a
commit
8a4874797b
8 changed files with 89 additions and 31 deletions
21
regression/test046.expr
Normal file
21
regression/test046.expr
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
n := read ();
|
||||
|
||||
case 3 of
|
||||
a -> write (a)
|
||||
| _ -> write (0)
|
||||
esac;
|
||||
|
||||
case 3 of
|
||||
a -> write (a)
|
||||
esac;
|
||||
|
||||
case 3 of
|
||||
a@_ -> write (a)
|
||||
esac;
|
||||
|
||||
case `a (1, 2, 3) of
|
||||
`b -> write (1)
|
||||
| a@`a (_, _, _) -> case a of
|
||||
`a (x, y, z) -> write (x); write (y); write (z)
|
||||
esac
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue