diff options
| author | Brian Campbell | 2017-12-05 11:31:02 +0000 |
|---|---|---|
| committer | Brian Campbell | 2017-12-06 17:36:59 +0000 |
| commit | c497bef0d49ec32afae584c63a0cee0730cb90b1 (patch) | |
| tree | 864a5c115090a4a810956303a843e5ce633d3493 /language | |
| parent | 17c518d94e5b2f531de47ee94ca0ceca09051f25 (diff) | |
Add top-level pattern match guards internally
Also fix bug in mono analysis with generated variables
Breaks lots of typechecking tests because it generates unnecessary
equality tests on units (and the tests don't have generic equality),
which I'll fix next.
Diffstat (limited to 'language')
| -rw-r--r-- | language/l2.ott | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/language/l2.ott b/language/l2.ott index 76fc0c77..70423cf5 100644 --- a/language/l2.ott +++ b/language/l2.ott @@ -1000,10 +1000,18 @@ effect_opt :: 'Effect_opt_' ::= | :: :: pure {{ com sugar for empty effect set }} | effectkw effect :: :: effect +% Generate a pexp, but from slightly different syntax (= rather than ->) +pexp_funcl :: 'Pat_funcl_' ::= + {{ auxparam 'a }} + {{ icho ('a pexp) }} + {{ lem (pexp 'a) }} + | pat = exp :: :: exp {{ ichlo (Pat_aux (Pat_exp [[pat]] [[exp]],Unknown)) }} + | pat when exp1 = exp :: :: when {{ ichlo (Pat_aux (Pat_when [[pat]] [[exp1]] [[exp]],Unknown)) }} + funcl :: 'FCL_' ::= {{ com function clause }} {{ aux _ annot }} {{ auxparam 'a }} - | id pat = exp :: :: Funcl + | id pexp_funcl :: :: Funcl fundef :: 'FD_' ::= |
