From: sof Date: Mon, 26 May 1997 04:31:19 +0000 (+0000) Subject: [project @ 1997-05-26 04:31:19 by sof] X-Git-Tag: Approximately_1000_patches_recorded~505 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9d6096d300a30cb3467e59a8806bfb3d1a243123;p=ghc-hetmet.git [project @ 1997-05-26 04:31:19 by sof] Updated imports; improved ppr --- diff --git a/ghc/compiler/main/ErrUtils.lhs b/ghc/compiler/main/ErrUtils.lhs index aba852b..6e6e99a 100644 --- a/ghc/compiler/main/ErrUtils.lhs +++ b/ghc/compiler/main/ErrUtils.lhs @@ -17,13 +17,11 @@ module ErrUtils ( IMP_Ubiq(){-uitous-} +import CmdLineOpts ( opt_PprUserLength ) import Bag --( bagToList ) -import PprStyle ( PprStyle(..) ) +import Outputable ( PprStyle(..), Outputable(..) ) import Pretty import SrcLoc ( noSrcLoc, SrcLoc{-instance-} ) -#if __GLASGOW_HASKELL__ >= 202 -import Outputable -#endif \end{code} \begin{code} @@ -33,7 +31,7 @@ type Message = PprStyle -> Doc addErrLoc :: SrcLoc -> String -> Error -> Error addErrLoc locn title rest_of_err_msg sty - = hang (hcat [ppr PprForUser locn, + = hang (hcat [ppr (PprForUser opt_PprUserLength) locn, if null title then empty else text (": " ++ title), char ':']) 4 (rest_of_err_msg sty) @@ -41,11 +39,11 @@ addErrLoc locn title rest_of_err_msg sty addShortErrLocLine, addShortWarnLocLine :: SrcLoc -> Error -> Error addShortErrLocLine locn rest_of_err_msg sty - = hang ((<>) (ppr PprForUser locn) (char ':')) + = hang ((<>) (ppr (PprForUser opt_PprUserLength) locn) (char ':')) 4 (rest_of_err_msg sty) addShortWarnLocLine locn rest_of_err_msg sty - = hang ((<>) (ppr PprForUser locn) (ptext SLIT(":warning:"))) + = hang ((<>) (ppr (PprForUser opt_PprUserLength) locn) (ptext SLIT(":warning:"))) 4 (rest_of_err_msg sty) dontAddErrLoc :: String -> Error -> Error