diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-29 16:57:16 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-29 16:57:16 +0100 |
commit | 3f5c0ad5d33096f4a8cd33217c3be7c32a7943b3 (patch) | |
tree | c1d7d94956d1c81f7dc550a94f0f3743adecfb94 /compiler/hsSyn | |
parent | ce1f1cd5f0ec5f07475e44cf2b7f72e0cbb8a963 (diff) | |
download | haskell-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.lhs | 6 |
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 |