summaryrefslogtreecommitdiff
path: root/src/Transfer/Core/Par.y
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-12-02 18:33:08 +0000
committerbringert <bringert@cs.chalmers.se>2005-12-02 18:33:08 +0000
commit983aef132b0695af7e1b16d77ad43180388eea71 (patch)
treeaa95e673e10ccc32e3e0fdf1556659c0c041aa53 /src/Transfer/Core/Par.y
parentdea5158cbf1c11d45f2ed91d9975fbc77245e652 (diff)
Transfer added guards and Eq derivation.
Diffstat (limited to 'src/Transfer/Core/Par.y')
-rw-r--r--src/Transfer/Core/Par.y23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Transfer/Core/Par.y b/src/Transfer/Core/Par.y
index 93d0545c3..661e0825b 100644
--- a/src/Transfer/Core/Par.y
+++ b/src/Transfer/Core/Par.y
@@ -22,8 +22,9 @@ import Transfer.ErrM
'(' { PT _ (TS "(") }
')' { PT _ (TS ")") }
'_' { PT _ (TS "_") }
- '\\' { PT _ (TS "\\") }
+ '|' { PT _ (TS "|") }
'->' { PT _ (TS "->") }
+ '\\' { PT _ (TS "\\") }
'.' { PT _ (TS ".") }
'Type' { PT _ (TS "Type") }
'case' { PT _ (TS "case") }
@@ -122,6 +123,16 @@ ListLetDef : {- empty -} { [] }
| LetDef ';' ListLetDef { (:) $1 $3 }
+Case :: { Case }
+Case : Pattern '|' Exp '->' Exp { Case $1 $3 $5 }
+
+
+ListCase :: { [Case] }
+ListCase : {- empty -} { [] }
+ | Case { (:[]) $1 }
+ | Case ';' ListCase { (:) $1 $3 }
+
+
Exp2 :: { Exp }
Exp2 : '\\' PatternVariable '->' Exp { EAbs $2 $4 }
| '(' PatternVariable ':' Exp ')' '->' Exp { EPi $2 $4 $7 }
@@ -174,16 +185,6 @@ Exp1 :: { Exp }
Exp1 : Exp2 { $1 }
-Case :: { Case }
-Case : Pattern '->' Exp { Case $1 $3 }
-
-
-ListCase :: { [Case] }
-ListCase : {- empty -} { [] }
- | Case { (:[]) $1 }
- | Case ';' ListCase { (:) $1 $3 }
-
-
{