projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add final newlines
[ghc-hetmet.git]
/
compiler
/
utils
/
Outputable.lhs
diff --git
a/compiler/utils/Outputable.lhs
b/compiler/utils/Outputable.lhs
index
f476849
..
fb0270f
100644
(file)
--- a/
compiler/utils/Outputable.lhs
+++ b/
compiler/utils/Outputable.lhs
@@
-36,11
+36,12
@@
module Outputable (
printSDoc, printErrs, hPrintDump, printDump,
printForC, printForAsm, printForUser, printForUserPartWay,
pprCode, mkCodeStyle,
printSDoc, printErrs, hPrintDump, printDump,
printForC, printForAsm, printForUser, printForUserPartWay,
pprCode, mkCodeStyle,
- showSDoc, showSDocForUser, showSDocDebug, showSDocDump,
+ showSDoc, showSDocForUser, showSDocDebug, showSDocDump, showPpr,
showSDocUnqual, showsPrecSDoc,
pprInfixVar, pprPrefixVar,
pprHsChar, pprHsString, pprHsInfix, pprHsVar,
showSDocUnqual, showsPrecSDoc,
pprInfixVar, pprPrefixVar,
pprHsChar, pprHsString, pprHsInfix, pprHsVar,
+ pprFastFilePath,
-- * Controlling the style in which output is printed
BindingSite(..),
-- * 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 Data.Word ( Word32 )
import System.IO ( Handle, stderr, stdout, hFlush )
import Data.Char ( ord )
+import System.FilePath
\end{code}
\end{code}
@@
-331,6
+333,9
@@
showSDocDump d = show (d PprDump)
showSDocDebug :: SDoc -> String
showSDocDebug d = show (d PprDebug)
showSDocDebug :: SDoc -> String
showSDocDebug d = show (d PprDebug)
+
+showPpr :: Outputable a => a -> String
+showPpr = showSDoc . ppr
\end{code}
\begin{code}
\end{code}
\begin{code}
@@
-599,6
+604,9
@@
isOperator ppr_v
('_':_) -> False -- Not an operator
(c:_) -> not (isAlpha c) -- Starts with non-alpha
_ -> False
('_':_) -> False -- Not an operator
(c:_) -> not (isAlpha c) -- Starts with non-alpha
_ -> False
+
+pprFastFilePath :: FastString -> SDoc
+pprFastFilePath path = text $ normalise $ unpackFS path
\end{code}
%************************************************************************
\end{code}
%************************************************************************