projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0180405
)
Do not go into an infinite loop when pretty-printer finds a negative indent (Trac...
author
simonpj@microsoft.com
<unknown>
Thu, 1 Mar 2007 11:45:13 +0000
(11:45 +0000)
committer
simonpj@microsoft.com
<unknown>
Thu, 1 Mar 2007 11:45:13 +0000
(11:45 +0000)
compiler/utils/Pretty.lhs
patch
|
blob
|
history
diff --git
a/compiler/utils/Pretty.lhs
b/compiler/utils/Pretty.lhs
index
31d65f2
..
0fc817f
100644
(file)
--- a/
compiler/utils/Pretty.lhs
+++ b/
compiler/utils/Pretty.lhs
@@
-225,6
+225,7
@@
allow you to use either GHC or Hugs. To get GHC, just set the CPP variable
#define GR >#
#define GREQ >=#
#define LT <#
#define GR >#
#define GREQ >=#
#define LT <#
+#define LTEQ <=#
#define DIV `quotInt#`
#define DIV `quotInt#`
@@
-994,11
+995,11
@@
cant_fail = error "easy_display: NoDoc"
indent n | n GREQ ILIT(8) = '\t' : indent (n MINUS ILIT(8))
| otherwise = spaces n
indent n | n GREQ ILIT(8) = '\t' : indent (n MINUS ILIT(8))
| otherwise = spaces n
-multi_ch ILIT(0) ch = ""
-multi_ch n ch = ch : multi_ch (n MINUS ILIT(1)) ch
+multi_ch n ch | n LTEQ ILIT(0) = ""
+ | otherwise = ch : multi_ch (n MINUS ILIT(1)) ch
-spaces ILIT(0) = ""
-spaces n = ' ' : spaces (n MINUS ILIT(1))
+spaces n | n LTEQ ILIT(0) = ""
+ | otherwise = ' ' : spaces (n MINUS ILIT(1))
\end{code}
\begin{code}
\end{code}
\begin{code}