comparison src/urweb.grm @ 1574:644558d9c756

Extend and document 'con' syntax with arguments
author Adam Chlipala <adam@chlipala.net>
date Sat, 15 Oct 2011 10:05:13 -0400
parents 5530a8075b62
children 911ebbd23919
comparison
equal deleted inserted replaced
1573:34364e383bed 1574:644558d9c756
704 | LPAREN sgn RPAREN (sgn) 704 | LPAREN sgn RPAREN (sgn)
705 705
706 sgi : CON SYMBOL DCOLON kind ((SgiConAbs (SYMBOL, kind), s (CONleft, kindright))) 706 sgi : CON SYMBOL DCOLON kind ((SgiConAbs (SYMBOL, kind), s (CONleft, kindright)))
707 | LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))), 707 | LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPEleft, SYMBOLright))),
708 s (LTYPEleft, SYMBOLright))) 708 s (LTYPEleft, SYMBOLright)))
709 | CON SYMBOL EQ cexp ((SgiCon (SYMBOL, NONE, cexp), s (CONleft, cexpright))) 709 | CON SYMBOL cargl2 kopt EQ cexp (let
710 | CON SYMBOL DCOLON kind EQ cexp ((SgiCon (SYMBOL, SOME kind, cexp), s (CONleft, cexpright))) 710 val loc = s (CONleft, cexpright)
711
712 val k = Option.getOpt (kopt, (KWild, loc))
713 val (c, k) = cargl2 (cexp, k)
714 in
715 (SgiCon (SYMBOL, SOME k, c), loc)
716 end)
711 | LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp), 717 | LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp),
712 s (LTYPEleft, cexpright))) 718 s (LTYPEleft, cexpright)))
713 | DATATYPE dtypes ((SgiDatatype dtypes, s (DATATYPEleft, dtypesright))) 719 | DATATYPE dtypes ((SgiDatatype dtypes, s (DATATYPEleft, dtypesright)))
714 | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path 720 | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path
715 (case dargs of 721 (case dargs of