summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/urweb.grm21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 65264cdf..db8b6294 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -298,6 +298,7 @@ fun tnamesOf (e, _) =
| mpath of string list
| cexp of con
+ | cexpO of con option
| capps of con
| cterm of con
| ctuple of con list
@@ -703,16 +704,24 @@ sgntm : SIG sgis END (SgnConst sgis, s (SIGleft, ENDright))
| sgntm WHERE LTYPE SYMBOL EQ cexp(SgnWhere (sgntm, SYMBOL, cexp), s (sgntmleft, cexpright))
| LPAREN sgn RPAREN (sgn)
-sgi : CON SYMBOL DCOLON kind ((SgiConAbs (SYMBOL, kind), s (CONleft, kindright)))
- | LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))),
+cexpO : (NONE)
+ | EQ cexp (SOME cexp)
+
+sgi : LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))),
s (LTYPEleft, SYMBOLright)))
- | CON SYMBOL cargl2 kopt EQ cexp (let
- val loc = s (CONleft, cexpright)
+ | CON SYMBOL cargl2 kopt cexpO (let
+ val loc = s (CONleft, cexpOright)
val k = Option.getOpt (kopt, (KWild, loc))
- val (c, k) = cargl2 (cexp, k)
in
- (SgiCon (SYMBOL, SOME k, c), loc)
+ case cexpO of
+ NONE => (SgiConAbs (SYMBOL, k), loc)
+ | SOME cexp =>
+ let
+ val (c, k) = cargl2 (cexp, k)
+ in
+ (SgiCon (SYMBOL, SOME k, c), loc)
+ end
end)
| LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp),
s (LTYPEleft, cexpright)))