mirror of
https://github.com/ilyakooo0/ormolu.git
synced 2024-09-19 20:57:17 +03:00
remove do-block braces in arguments
This commit is contained in:
parent
46ede8aa35
commit
3b745c723e
@ -27,3 +27,8 @@ f8 = foo \x ->
|
||||
y
|
||||
|
||||
f9 = foo do { bar } baz
|
||||
|
||||
f10 = foo
|
||||
do a
|
||||
do b
|
||||
do c
|
||||
|
@ -23,3 +23,8 @@ f8 = foo \x ->
|
||||
y
|
||||
|
||||
f9 = foo do { bar } baz
|
||||
|
||||
f10 = foo
|
||||
do { a }
|
||||
do { b }
|
||||
do c
|
||||
|
@ -18,6 +18,7 @@ import Ctype (is_space)
|
||||
import Data.Bool (bool)
|
||||
import Data.Char (isPunctuation, isSymbol)
|
||||
import Data.Data hiding (Infix, Prefix)
|
||||
import Data.Functor ((<&>))
|
||||
import Data.List (intersperse, sortOn)
|
||||
import Data.List.NonEmpty ((<|), NonEmpty ((:|)))
|
||||
import qualified Data.List.NonEmpty as NE
|
||||
@ -565,7 +566,10 @@ p_hsExpr' s = \case
|
||||
if isOneLineSpan spn
|
||||
then inci
|
||||
else id
|
||||
useBraces $ do
|
||||
ub <- getLayout <&> \case
|
||||
SingleLine -> useBraces
|
||||
MultiLine -> id
|
||||
ub $ do
|
||||
located func (p_hsExpr' s)
|
||||
breakpoint
|
||||
indent $ sep breakpoint (located' p_hsExpr) initp
|
||||
|
Loading…
Reference in New Issue
Block a user