From: simonpj Date: Mon, 30 Sep 2002 13:38:30 +0000 (+0000) Subject: [project @ 2002-09-30 13:38:30 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1604 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=10539b475d8584e58bb2c6db928e102ee63e5af5;p=ghc-hetmet.git [project @ 2002-09-30 13:38:30 by simonpj] Minor wibble --- diff --git a/ghc/compiler/rename/RnExpr.lhs b/ghc/compiler/rename/RnExpr.lhs index 66ec772..36bbc4b 100644 --- a/ghc/compiler/rename/RnExpr.lhs +++ b/ghc/compiler/rename/RnExpr.lhs @@ -286,7 +286,7 @@ rnExpr e@(HsDo do_or_lc stmts _ _ src_loc) -- Check the statement list ends in an expression case last stmts' of { ResultStmt _ _ -> returnM () ; - _ -> addErr (doStmtListErr (binder_name do_or_lc) e) + _ -> addErr (doStmtListErr do_or_lc e) } `thenM_` -- Generate the rebindable syntax for the monad @@ -305,9 +305,6 @@ rnExpr e@(HsDo do_or_lc stmts _ _ src_loc) syntax_names MDoExpr = monadNames ++ [mfixName] syntax_names other = [] - binder_name MDoExpr = "mdo" - binder_name other = "do" - rnExpr (ExplicitList _ exps) = rnExprs exps `thenM` \ (exps', fvs) -> returnM (ExplicitList placeHolderType exps', fvs `addOneFV` listTyCon_name) @@ -906,9 +903,13 @@ patSynErr e = sep [ptext SLIT("Pattern syntax in expression context:"), nest 4 (ppr e)] -doStmtListErr name e - = sep [quotes (text name) <+> ptext SLIT("statements must end in expression:"), +doStmtListErr do_or_lc e + = sep [quotes (text binder_name) <+> ptext SLIT("statements must end in expression:"), nest 4 (ppr e)] + where + binder_name = case do_or_lc of + MDoExpr -> "mdo" + other -> "do" thErr what = ptext SLIT("Template Haskell") <+> text what <+>