Fix PRMMinimize behaviour on simple paren'ed expressions
parent
62fe073305
commit
6b7526c360
|
@ -1059,3 +1059,10 @@ func = do
|
||||||
stmt2
|
stmt2
|
||||||
)
|
)
|
||||||
`shouldReturn` thing
|
`shouldReturn` thing
|
||||||
|
|
||||||
|
#golden minimize parens basic test
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func (abc) (def)
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func abc def
|
||||||
|
|
|
@ -184,8 +184,9 @@ addAllParens topLevelParen = \case
|
||||||
|
|
||||||
remSuperfluousParens :: Int -> OpTree -> OpTree
|
remSuperfluousParens :: Int -> OpTree -> OpTree
|
||||||
remSuperfluousParens outerFixity = \case
|
remSuperfluousParens outerFixity = \case
|
||||||
x@OpLeaf{} -> x
|
x@OpLeaf{} -> x
|
||||||
x@OpUnknown{} -> x
|
OpUnknown _ locO locC c [] -> OpUnknown NoParen locO locC c []
|
||||||
|
x@OpUnknown{} -> x
|
||||||
OpKnown paren locO locC fixity c cs ->
|
OpKnown paren locO locC fixity c cs ->
|
||||||
OpKnown
|
OpKnown
|
||||||
-- We do not support removing superfluous parens around
|
-- We do not support removing superfluous parens around
|
||||||
|
|
Loading…
Reference in New Issue