Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yiming Yang
GHC
Commits
e376c9e1
Commit
e376c9e1
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 19:52:58 by sof]
new values: pprDumpStyle, pprErrorsStyle;new function printErrs
parent
83401d92
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/utils/Outputable.lhs
+19
-2
19 additions, 2 deletions
ghc/compiler/utils/Outputable.lhs
with
19 additions
and
2 deletions
ghc/compiler/utils/Outputable.lhs
+
19
−
2
View file @
e376c9e1
...
...
@@ -20,7 +20,9 @@ module Outputable (
ifPprInterface,
pprQuote,
printDoc, interppSP, interpp'SP,
printDoc, printErrs, pprCols, pprDumpStyle, pprErrorsStyle,
interppSP, interpp'SP,
speakNth
...
...
@@ -38,6 +40,7 @@ import Ubiq ( Uniquable(..), Unique, Name ) -- FastString mentions it; todo: rm
#endif
import CmdLineOpts ( opt_PprStyle_All, opt_PprStyle_Debug, opt_PprStyle_User )
import FastString
import Pretty
import Util ( cmpPString )
...
...
@@ -156,15 +159,29 @@ instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c) wher
%************************************************************************
\begin{code}
pprCols = (100 :: Int) -- could make configurable
-- pprErrorsStyle is the style to print ordinary error messages with
-- pprDumpStyle is the style to print -ddump-xx information in
(pprDumpStyle, pprErrorsStyle)
| opt_PprStyle_All = (PprShowAll, PprShowAll)
| opt_PprStyle_Debug = (PprDebug, PprDebug)
| otherwise = (PprDebug, PprQuote)
printDoc :: Mode -> Handle -> Doc -> IO ()
printDoc mode hdl doc
= fullRender mode
100
1.5 put done doc
= fullRender mode
pprCols
1.5 put done doc
where
put (Chr c) next = hPutChar hdl c >> next
put (Str s) next = hPutStr hdl s >> next
put (PStr s) next = hPutFS hdl s >> next
done = hPutChar hdl '\n'
-- I'm not sure whether the direct-IO approach of printDoc
-- above is better or worse than the put-big-string approach here
printErrs :: Doc -> IO ()
printErrs doc = hPutStr stderr (show (doc $$ text ""))
\end{code}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment