From 5be879dd543d61f871f76586251fe0aad91c0bcc Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 6 Dec 2005 15:57:43 +0000 Subject: 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. --- src/Transfer/Syntax/Par.y | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Transfer/Syntax/Par.y') 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 } -- cgit v1.2.3