From 10539b475d8584e58bb2c6db928e102ee63e5af5 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 30 Sep 2002 13:38:30 +0000 Subject: [PATCH] [project @ 2002-09-30 13:38:30 by simonpj] Minor wibble --- ghc/compiler/rename/RnExpr.lhs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 <+> -- 1.7.10.4