comparison src/urweb.grm @ 1577:911ebbd23919

Fix parsing conflict
author Adam Chlipala <adam@chlipala.net>
date Sat, 15 Oct 2011 13:30:59 -0400
parents 644558d9c756
children e44be6ece475
comparison
equal deleted inserted replaced
1576:f6c74b4bc4e6 1577:911ebbd23919
296 | cpath of string list * string 296 | cpath of string list * string
297 | spath of str 297 | spath of str
298 | mpath of string list 298 | mpath of string list
299 299
300 | cexp of con 300 | cexp of con
301 | cexpO of con option
301 | capps of con 302 | capps of con
302 | cterm of con 303 | cterm of con
303 | ctuple of con list 304 | ctuple of con list
304 | ctuplev of con list 305 | ctuplev of con list
305 | ident of con 306 | ident of con
701 s (mpathleft, mpathright)) 702 s (mpathleft, mpathright))
702 | sgntm WHERE CON SYMBOL EQ cexp (SgnWhere (sgntm, SYMBOL, cexp), s (sgntmleft, cexpright)) 703 | sgntm WHERE CON SYMBOL EQ cexp (SgnWhere (sgntm, SYMBOL, cexp), s (sgntmleft, cexpright))
703 | sgntm WHERE LTYPE SYMBOL EQ cexp(SgnWhere (sgntm, SYMBOL, cexp), s (sgntmleft, cexpright)) 704 | sgntm WHERE LTYPE SYMBOL EQ cexp(SgnWhere (sgntm, SYMBOL, cexp), s (sgntmleft, cexpright))
704 | LPAREN sgn RPAREN (sgn) 705 | LPAREN sgn RPAREN (sgn)
705 706
706 sgi : CON SYMBOL DCOLON kind ((SgiConAbs (SYMBOL, kind), s (CONleft, kindright))) 707 cexpO : (NONE)
707 | LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))), 708 | EQ cexp (SOME cexp)
709
710 sgi : LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))),
708 s (LTYPEleft, SYMBOLright))) 711 s (LTYPEleft, SYMBOLright)))
709 | CON SYMBOL cargl2 kopt EQ cexp (let 712 | CON SYMBOL cargl2 kopt cexpO (let
710 val loc = s (CONleft, cexpright) 713 val loc = s (CONleft, cexpOright)
711 714
712 val k = Option.getOpt (kopt, (KWild, loc)) 715 val k = Option.getOpt (kopt, (KWild, loc))
713 val (c, k) = cargl2 (cexp, k) 716 in
714 in 717 case cexpO of
715 (SgiCon (SYMBOL, SOME k, c), loc) 718 NONE => (SgiConAbs (SYMBOL, k), loc)
719 | SOME cexp =>
720 let
721 val (c, k) = cargl2 (cexp, k)
722 in
723 (SgiCon (SYMBOL, SOME k, c), loc)
724 end
716 end) 725 end)
717 | LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp), 726 | LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp),
718 s (LTYPEleft, cexpright))) 727 s (LTYPEleft, cexpright)))
719 | DATATYPE dtypes ((SgiDatatype dtypes, s (DATATYPEleft, dtypesright))) 728 | DATATYPE dtypes ((SgiDatatype dtypes, s (DATATYPEleft, dtypesright)))
720 | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path 729 | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path