summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-09-29 16:57:16 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-09-29 16:57:16 +0100
commit3f5c0ad5d33096f4a8cd33217c3be7c32a7943b3 (patch)
treec1d7d94956d1c81f7dc550a94f0f3743adecfb94 /compiler/hsSyn
parentce1f1cd5f0ec5f07475e44cf2b7f72e0cbb8a963 (diff)
downloadhaskell-3f5c0ad5d33096f4a8cd33217c3be7c32a7943b3.tar.gz
Fix parenthesisation in conversion from TH.Exp to HsExpr.HsExpr
We need to generate enough parens so that -ddump-splices is correct Haskell. There is certainly further to go.
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/Convert.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs
index ff9aa85f96..b1fd047421 100644
--- a/compiler/hsSyn/Convert.lhs
+++ b/compiler/hsSyn/Convert.lhs
@@ -504,7 +504,11 @@ cvtl e = wrapL (cvt e)
-- Can I indicate this is an infix thing?
-- Note [Dropping constructors]
- cvt (UInfixE x s y) = do { x' <- cvtl x; cvtOpApp x' s y } -- Note [Converting UInfix]
+ cvt (UInfixE x s y) = do { x' <- cvtl x
+ ; let x'' = case x' of
+ L _ (OpApp {}) -> x'
+ _ -> mkLHsPar x'
+ ; cvtOpApp x'' s y } -- Note [Converting UInfix]
cvt (ParensE e) = do { e' <- cvtl e; return $ HsPar e' }
cvt (SigE e t) = do { e' <- cvtl e; t' <- cvtType t