[commit: ghc] wip/orf-reboot: Pretty-print HsSingleRecFld like HsVar (a5b8489)

git at git.haskell.org git at git.haskell.org
Fri Mar 27 15:47:01 UTC 2015


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

On branch  : wip/orf-reboot
Link       : http://ghc.haskell.org/trac/ghc/changeset/a5b84898472376e4c8056956de04e70684d72f6e/ghc

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

commit a5b84898472376e4c8056956de04e70684d72f6e
Author: Adam Gundry <adam at well-typed.com>
Date:   Fri Mar 20 14:37:27 2015 +0000

    Pretty-print HsSingleRecFld like HsVar


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

a5b84898472376e4c8056956de04e70684d72f6e
 compiler/hsSyn/HsExpr.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 14f3c92..1cb945d 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -813,6 +813,7 @@ hsExprNeedsParens (HsRnBracketOut {}) = False
 hsExprNeedsParens (HsTcBracketOut {}) = False
 hsExprNeedsParens (HsDo sc _ _)
        | isListCompExpr sc            = False
+hsExprNeedsParens (HsSingleRecFld{})  = False
 hsExprNeedsParens _ = True
 
 
@@ -825,6 +826,7 @@ isAtomicHsExpr (HsIPVar {})   = True
 isAtomicHsExpr (HsUnboundVar {}) = True
 isAtomicHsExpr (HsWrap _ e)   = isAtomicHsExpr e
 isAtomicHsExpr (HsPar e)      = isAtomicHsExpr (unLoc e)
+isAtomicHsExpr (HsSingleRecFld{}) = True
 isAtomicHsExpr _              = False
 
 {-



More information about the ghc-commits mailing list