diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-01-02 15:38:52 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-01-02 15:38:52 -0500 |
commit | 4ba08c6664fa5f5ccfca375ab32f1209763837b9 (patch) | |
tree | 2cefe2589f0627300276714fc322dc41847fd306 /src/urweb.grm | |
parent | 4a8e2581525036133130422b4fc747f9e5664146 (diff) |
Add arguments to [type] declarations and signature items
Diffstat (limited to 'src/urweb.grm')
-rw-r--r-- | src/urweb.grm | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/urweb.grm b/src/urweb.grm index 1a9eb855..a495bfe6 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -473,8 +473,14 @@ decl : CON SYMBOL cargl2 kopt EQ cexp (let in [(DCon (SYMBOL, SOME k, c), loc)] end) - | LTYPE SYMBOL EQ cexp ([(DCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp), - s (LTYPEleft, cexpright))]) + | LTYPE SYMBOL cargl2 EQ cexp (let + val loc = s (LTYPEleft, cexpright) + + val k = (KWild, loc) + val (c, k) = cargl2 (cexp, k) + in + [(DCon (SYMBOL, SOME k, c), loc)] + end) | DATATYPE dtypes ([(DDatatype dtypes, s (DATATYPEleft, dtypesright))]) | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path (case dargs of @@ -756,8 +762,20 @@ sgi : LTYPE SYMBOL ((SgiConAbs (SYMBOL, (KType, s (LTYPElef (SgiCon (SYMBOL, SOME k, c), loc) end end) - | LTYPE SYMBOL EQ cexp ((SgiCon (SYMBOL, SOME (KType, s (LTYPEleft, cexpright)), cexp), - s (LTYPEleft, cexpright))) + | LTYPE SYMBOL cargl2 cexpO (let + val loc = s (LTYPEleft, cexpOright) + + val k = (KWild, loc) + in + 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) | DATATYPE dtypes ((SgiDatatype dtypes, s (DATATYPEleft, dtypesright))) | DATATYPE SYMBOL dargs EQ DATATYPE CSYMBOL DOT path (case dargs of |