Fix bug in PRMMinimize feature for InfixN operators
parent
812957dca4
commit
2fd6308d09
|
@ -25,3 +25,7 @@ func = func ((((((((nested + expression))))))))
|
|||
#expected
|
||||
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||
func = func (nested + expression)
|
||||
|
||||
#test does not remove parens on InfixN
|
||||
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||
func = (a == Foo) == (b == Bar)
|
||||
|
|
|
@ -215,7 +215,13 @@ remSuperfluousParens outerFixity = \case
|
|||
locO
|
||||
locC
|
||||
fixity
|
||||
(remSuperfluousParens (fixLevel fixity) c)
|
||||
(remSuperfluousParens
|
||||
(case fixity of
|
||||
Fixity _ level InfixN -> level + 1
|
||||
Fixity _ level _ -> level
|
||||
)
|
||||
c
|
||||
)
|
||||
[ (op, remSuperfluousParens (fixLevel fixity) tree) | (op, tree) <- cs ]
|
||||
x -> x
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue