summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-10-15 13:30:59 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-10-15 13:30:59 -0400
commitaa7c1c71c48c8829e59800d15849ad0d99205918 (patch)
tree94479a0c35c4d83197492266e15c3da79a46a713
parent27b7ae9ca08e4675341166928806f66623132ae2 (diff)
Fix parsing conflict
-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)))