[project @ 2002-09-27 17:12:23 by erkok]
[ghc-hetmet.git] / ghc / compiler / rename / RnExpr.lhs
index 299bb31..66ec772 100644 (file)
@@ -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 "do" e)
+       _              -> addErr (doStmtListErr (binder_name do_or_lc)  e)
     }                                  `thenM_`
 
        -- Generate the rebindable syntax for the monad
@@ -305,6 +305,9 @@ 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)