diff -u dhsparser/HsParser.ly hsparser/HsParser.ly --- dhsparser/HsParser.ly Tue Oct 26 13:51:48 1999 +++ hsparser/HsParser.ly Thu Sep 10 13:55:10 1998 @@ -107,8 +107,6 @@ > 'module' { KW_Module } > 'newtype' { KW_NewType } > 'of' { KW_Of } -> 'receive' { KW_Receive } -> 'receiveAfter' { KW_ReceiveAfter } > 'then' { KW_Then } > 'type' { KW_Type } > 'where' { KW_Where } @@ -490,8 +488,6 @@ > | 'let' decllist 'in' exp { HsLet $2 $4 } > | 'if' exp 'then' exp 'else' exp { HsIf $2 $4 $6 } > | 'case' exp 'of' altslist { HsCase $2 $4 } -> | 'receive' altslist { HsReceive $2 } -> | 'receiveAfter' exp '->' infixexp 'in' altslist { HsReceiveAfter $2 $4 $6 } > | '-' fexp { HsNegApp $2 } > | 'do' stmtlist { HsDo $2 } > | fexp { $1 } @@ -503,7 +499,6 @@ > aexps :: { [HsExp] } > : aexps aexp { $2 : $1 } > | aexp { [$1] } - UGLY: Because patterns and expressions are mixed, aexp has to be split into two rules: One left-recursive and one right-recursive. Otherwise we get two diff -u dhsparser/HsPretty.hs hsparser/HsPretty.hs --- dhsparser/HsPretty.hs Mon Sep 20 16:19:25 1999 +++ hsparser/HsPretty.hs Thu Sep 10 14:04:51 1998 @@ -223,15 +223,6 @@ text "else", ppHsExp elsexp] ppHsExp (HsCase cond altList) = myFsep[text "case", ppHsExp cond, text "of"] $$$ body caseIndent (map ppHsAlt altList) -ppHsExp (HsReceive altList) = myFsep[text "receive (\\neueV -> case neueV of"] - $$$ body caseIndent (map ppRcvHsAlt altList) - $$$ myFsep [text " _ -> Nothing"] - $$$ text ")" -ppHsExp (HsReceiveAfter timeout f altList) = myFsep[text "receiveAfter", ppHsExp timeout, ppHsExp f, text "(\\neueV -> case neueV of"] - $$$ body caseIndent (map ppRcvHsAlt altList) - $$$ myFsep [text " _ -> Nothing"] - $$$ text ")" - ppHsExp (HsDo stmtList) = text "do" $$$ body doIndent (map ppHsStmt stmtList) -- Constructors & Vars ppHsExp (HsVar name) = ppHsNameParen name @@ -305,17 +296,6 @@ ppGAlt (HsGuardedAlt pos exp body) = myFsep [char '|', ppHsExp exp, text "->", ppHsExp body] -------------------------- Receive bodies ------------------------- -ppRcvHsAlt :: HsAlt -> Doc -ppRcvHsAlt (HsAlt pos exp gAlts decls) = - ppHsPat exp <+> ppRcvGAlts gAlts $$$ ppWhere decls - -ppRcvGAlts :: HsGuardedAlts -> Doc -ppRcvGAlts (HsUnGuardedAlt exp) = text "-> Just $" <+> ppHsExp exp -ppRcvGAlts (HsGuardedAlts altList) = myVcat . map ppRcvGAlt $ altList - -ppRcvGAlt (HsGuardedAlt pos exp body) = - myFsep [char '|', ppHsExp exp, text "-> Just $", ppHsExp body] ------------------------- Statements in monads & list comprehensions ----- ppHsStmt :: HsStmt -> Doc diff -u dhsparser/HsSyn.lhs hsparser/HsSyn.lhs --- dhsparser/HsSyn.lhs Mon Sep 20 16:12:54 1999 +++ hsparser/HsSyn.lhs Thu Sep 10 13:27:57 1998 @@ -133,8 +133,6 @@ > | HsLet [HsDecl] HsExp > | HsIf HsExp HsExp HsExp > | HsCase HsExp [HsAlt] -> | HsReceive [HsAlt] -> | HsReceiveAfter HsExp HsExp [HsAlt] > | HsDo [HsStmt] > | HsTuple [HsExp] > | HsList [HsExp] diff -u dhsparser/Lexer.lhs hsparser/Lexer.lhs --- dhsparser/Lexer.lhs Tue Sep 21 11:53:25 1999 +++ hsparser/Lexer.lhs Fri Jul 31 12:02:38 1998 @@ -82,8 +82,6 @@ > | KW_Module > | KW_NewType > | KW_Of -> | KW_Receive -> | KW_ReceiveAfter > | KW_Then > | KW_Type > | KW_Where @@ -128,8 +126,6 @@ > ( "module", KW_Module ), > ( "newtype", KW_NewType ), > ( "of", KW_Of ), -> ( "receive", KW_Receive ), -> ( "receiveAfter", KW_ReceiveAfter ), > ( "then", KW_Then ), > ( "type", KW_Type ), > ( "where", KW_Where ), diff -u dhsparser/Makefile hsparser/Makefile --- dhsparser/Makefile Wed Sep 8 11:03:39 1999 +++ hsparser/Makefile Fri May 15 11:38:45 1998 @@ -1,6 +1,6 @@ # $Id$ -HC = ghc-2.10 +HC = ghc OPT = -O HCFLAGS = $(OPT) -cpp -recomp -fwarn-incomplete-patterns -H20M -fglasgow-exts diff -u dhsparser/ParseUtils.lhs hsparser/ParseUtils.lhs --- dhsparser/ParseUtils.lhs Tue Sep 21 12:24:42 1999 +++ hsparser/ParseUtils.lhs Wed Jul 29 16:56:14 1998 @@ -137,12 +137,6 @@ > HsCase e alts -> mapP checkAlt alts `thenP` \alts -> > checkExpr e `thenP` \e -> > returnP (HsCase e alts) -> HsReceive alts -> mapP checkAlt alts `thenP` \alts -> -> returnP (HsReceive alts) -> HsReceiveAfter e1 e2 alts -> mapP checkAlt alts `thenP` \alts -> -> -- checkExpr e1 `thenP` \e1 -> -> -- checkExpr e2 `thenP` \e2 -> -> returnP (HsReceiveAfter e1 e2 alts) > HsDo stmts -> mapP checkStmt stmts `thenP` (returnP . HsDo) > HsTuple es -> checkManyExprs es HsTuple > HsList es -> checkManyExprs es HsList