summaryrefslogtreecommitdiff
path: root/src/Transfer/Syntax/Par.y
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-12-06 15:57:43 +0000
committerbringert <bringert@cs.chalmers.se>2005-12-06 15:57:43 +0000
commit5be879dd543d61f871f76586251fe0aad91c0bcc (patch)
treed2bd110cbbfaeaf7c85f0ae7e1aeb7fdd93824fe /src/Transfer/Syntax/Par.y
parent54b8d70443f2b41691339376677f50c7e5f62fca (diff)
Transfer: Changed BNFC's layout syntax resolver to add a semicolon at EOF if using top-level layout sytax. Changed transfer syntax to use this to force semicolon after imports when pretty printing transfer. transfer grammar printer now produces Transfer syntax, not core. It also imports prelude and includes Eq and Compos instances.
Diffstat (limited to 'src/Transfer/Syntax/Par.y')
-rw-r--r--src/Transfer/Syntax/Par.y8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Transfer/Syntax/Par.y b/src/Transfer/Syntax/Par.y
index 61a2788ef..9504268f6 100644
--- a/src/Transfer/Syntax/Par.y
+++ b/src/Transfer/Syntax/Par.y
@@ -78,7 +78,7 @@ Integer :: { Integer } : L_integ { (read $1) :: Integer }
Double :: { Double } : L_doubl { (read $1) :: Double }
Module :: { Module }
-Module : ListImport ListDecl { Module $1 $2 }
+Module : ListImport ListDecl { Module (reverse $1) (reverse $2) }
Import :: { Import }
@@ -87,8 +87,7 @@ Import : 'import' Ident { Import $2 }
ListImport :: { [Import] }
ListImport : {- empty -} { [] }
- | Import { (:[]) $1 }
- | Import ';' ListImport { (:) $1 $3 }
+ | ListImport Import ';' { flip (:) $1 $2 }
Decl :: { Decl }
@@ -100,8 +99,7 @@ Decl : 'data' Ident ':' Exp 'where' '{' ListConsDecl '}' { DataDecl $2 $4 $7 }
ListDecl :: { [Decl] }
ListDecl : {- empty -} { [] }
- | Decl { (:[]) $1 }
- | Decl ';' ListDecl { (:) $1 $3 }
+ | ListDecl Decl ';' { flip (:) $1 $2 }
ConsDecl :: { ConsDecl }