File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -89,25 +89,26 @@ hasAttrOp = getSpecialOperator NHasAttrOp
8989-- | Determine if to return doc wraped into parens,
9090-- according the given operator.
9191precedenceWrap :: OperatorInfo -> NixDoc ann -> Doc ann
92- precedenceWrap op sub =
93- maybeWrap ( getDoc sub)
92+ precedenceWrap op subExpr =
93+ maybeWrap $ getDoc subExpr
9494 where
9595 maybeWrap :: Doc ann -> Doc ann
9696 maybeWrap =
9797 bool
9898 parens
9999 id
100100 needsParens
101+ where
102+ needsParens :: Bool
103+ needsParens =
104+ precedence root < precedence op
105+ || ( precedence root == precedence op
106+ && associativity root == associativity op
107+ && associativity op /= NAssocNone
108+ )
101109
102- root = rootOp sub
110+ root = rootOp subExpr
103111
104- needsParens :: Bool
105- needsParens =
106- precedence root < precedence op
107- || (precedence root == precedence op
108- && associativity root == associativity op
109- && associativity op /= NAssocNone
110- )
111112
112113-- Used in the selector case to print a path in a selector as
113114-- "${./abc}"
You can’t perform that action at this time.
0 commit comments