[commit: ghc] master: Improve pretty-printing of pending splices (c42d5ca)

git at git.haskell.org git at git.haskell.org
Fri Nov 22 16:39:29 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c42d5ca540c73e63aa658f2ce9065ce90542fbde/ghc

>---------------------------------------------------------------

commit c42d5ca540c73e63aa658f2ce9065ce90542fbde
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Nov 22 07:54:18 2013 +0000

    Improve pretty-printing of pending splices


>---------------------------------------------------------------

c42d5ca540c73e63aa658f2ce9065ce90542fbde
 compiler/hsSyn/HsExpr.lhs |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/compiler/hsSyn/HsExpr.lhs b/compiler/hsSyn/HsExpr.lhs
index 4b62b15..bb0f2d9 100644
--- a/compiler/hsSyn/HsExpr.lhs
+++ b/compiler/hsSyn/HsExpr.lhs
@@ -358,11 +358,10 @@ data PendingSplice
 
 Note [Pending Splices]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 Now that untyped brackets are not type checked, we need a mechanism to ensure
 that splices contained in untyped brackets *are* type checked. Therefore the
 renamer now renames every HsBracket into a HsRnBracketOut, which contains the
-splices that need to be type checked. There are three varieties of pending
+splices that need to be type checked. There are four varieties of pending
 splices generated by the renamer:
 
  * Pending expression splices (PendingRnExpSplice), e.g.,
@@ -381,7 +380,7 @@ splices generated by the renamer:
 
    \x -> [| x |]
 
-There is a fourth variety of pending splice, which is generated by the type
+There is a fifth variety of pending splice, which is generated by the type
 checker:
 
   * Pending *typed* expression splices, (PendingTcSplice), e.g.,
@@ -601,10 +600,11 @@ ppr_expr (HsType id)      = ppr id
 
 ppr_expr (HsSpliceE s)        = pprSplice s
 ppr_expr (HsBracket b)        = pprHsBracket b
-ppr_expr (HsRnBracketOut e _) = ppr e
-ppr_expr (HsBracketOut e [])  = ppr e
-ppr_expr (HsBracketOut e ps)  = ppr e $$ ptext (sLit "pending") <+> ppr ps
-ppr_expr (HsQuasiQuoteE qq)   = ppr qq
+ppr_expr (HsRnBracketOut e []) = ppr e
+ppr_expr (HsRnBracketOut e ps) = ppr e $$ ptext (sLit "pending(rn)") <+> ppr ps
+ppr_expr (HsBracketOut e [])   = ppr e
+ppr_expr (HsBracketOut e ps)   = ppr e $$ ptext (sLit "pending(tc)") <+> ppr ps
+ppr_expr (HsQuasiQuoteE qq)    = ppr qq
 
 ppr_expr (HsProc pat (L _ (HsCmdTop cmd _ _ _)))
   = hsep [ptext (sLit "proc"), ppr pat, ptext (sLit "->"), ppr cmd]



More information about the ghc-commits mailing list