summaryrefslogtreecommitdiff
path: root/src/urweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-01-02 15:38:52 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2012-01-02 15:38:52 -0500
commitcf29709cf040f86708b44778858d78d1bc4468c6 (patch)
tree2cefe2589f0627300276714fc322dc41847fd306 /src/urweb.grm
parent25466e49ee9461fad6330b08959f5236767f6e55 (diff)
Add arguments to [type] declarations and signature items
Diffstat (limited to 'src/urweb.grm')
-rw-r--r--src/urweb.grm26
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