From 6e5eafac797562bc2a72068dd27f19adc75bdb41 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 26 Aug 2008 14:44:52 +0000 Subject: [PATCH] Move pprFastFilePath from SrcLoc to Outputable --- compiler/basicTypes/SrcLoc.lhs | 4 ---- compiler/utils/Outputable.lhs | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/basicTypes/SrcLoc.lhs b/compiler/basicTypes/SrcLoc.lhs index a342c89..0789693 100644 --- a/compiler/basicTypes/SrcLoc.lhs +++ b/compiler/basicTypes/SrcLoc.lhs @@ -71,7 +71,6 @@ module SrcLoc ( import Util import Outputable import FastString -import System.FilePath \end{code} %************************************************************************ @@ -166,9 +165,6 @@ cmpSrcLoc (SrcLoc s1 l1 c1) (SrcLoc s2 l2 c2) = (s1 `compare` s2) `thenCmp` (l1 `compare` l2) `thenCmp` (c1 `compare` c2) cmpSrcLoc (SrcLoc _ _ _) _other = GT -pprFastFilePath :: FastString -> SDoc -pprFastFilePath path = text $ normalise $ unpackFS path - instance Outputable SrcLoc where ppr (SrcLoc src_path src_line src_col) = getPprStyle $ \ sty -> diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index f476849..548dc2c 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -41,6 +41,7 @@ module Outputable ( pprInfixVar, pprPrefixVar, pprHsChar, pprHsString, pprHsInfix, pprHsVar, + pprFastFilePath, -- * Controlling the style in which output is printed BindingSite(..), @@ -74,6 +75,7 @@ import Panic import Data.Word ( Word32 ) import System.IO ( Handle, stderr, stdout, hFlush ) import Data.Char ( ord ) +import System.FilePath \end{code} @@ -599,6 +601,9 @@ isOperator ppr_v ('_':_) -> False -- Not an operator (c:_) -> not (isAlpha c) -- Starts with non-alpha _ -> False + +pprFastFilePath :: FastString -> SDoc +pprFastFilePath path = text $ normalise $ unpackFS path \end{code} %************************************************************************ -- 1.7.10.4