Commit a9a775ab authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improve pretty printing for 'rec' Stmts, using pprDeeper

Fixes Trac #7074
parent 088a9081
...@@ -1121,7 +1121,7 @@ pprStmt (TransStmt { trS_stmts = stmts, trS_by = by, trS_using = using, trS_form ...@@ -1121,7 +1121,7 @@ pprStmt (TransStmt { trS_stmts = stmts, trS_by = by, trS_using = using, trS_form
pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids
, recS_later_ids = later_ids }) , recS_later_ids = later_ids })
= ptext (sLit "rec") <+> = ptext (sLit "rec") <+>
vcat [ braces (vcat (map ppr segment)) vcat [ ppr_do_stmts segment
, ifPprDebug (vcat [ ptext (sLit "rec_ids=") <> ppr rec_ids , ifPprDebug (vcat [ ptext (sLit "rec_ids=") <> ppr rec_ids
, ptext (sLit "later_ids=") <> ppr later_ids])] , ptext (sLit "later_ids=") <> ppr later_ids])]
...@@ -1153,7 +1153,7 @@ pprDo PArrComp stmts = paBrackets $ pprComp stmts ...@@ -1153,7 +1153,7 @@ pprDo PArrComp stmts = paBrackets $ pprComp stmts
pprDo MonadComp stmts = brackets $ pprComp stmts pprDo MonadComp stmts = brackets $ pprComp stmts
pprDo _ _ = panic "pprDo" -- PatGuard, ParStmtCxt pprDo _ _ = panic "pprDo" -- PatGuard, ParStmtCxt
ppr_do_stmts :: OutputableBndr id => [LStmt id] -> SDoc ppr_do_stmts :: (OutputableBndr idL, OutputableBndr idR) => [LStmtLR idL idR] -> SDoc
-- Print a bunch of do stmts, with explicit braces and semicolons, -- Print a bunch of do stmts, with explicit braces and semicolons,
-- so that we are not vulnerable to layout bugs -- so that we are not vulnerable to layout bugs
ppr_do_stmts stmts ppr_do_stmts stmts
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment