mirror of
https://github.com/google/ormolu.git
synced 2024-11-27 13:13:23 +03:00
Hang expressions in if-then-else
This commit is contained in:
parent
9a1f5ebd87
commit
8cb86d3fac
@ -10,7 +10,14 @@ bar x =
|
||||
then
|
||||
foo x
|
||||
+ 100
|
||||
else
|
||||
case x of
|
||||
1 -> 10
|
||||
_ -> 20
|
||||
else case x of
|
||||
1 -> 10
|
||||
_ -> 20
|
||||
|
||||
baz :: Int -> Bar
|
||||
baz x =
|
||||
if x > 5
|
||||
then \case
|
||||
Foo -> bar
|
||||
else do
|
||||
undefined
|
||||
|
@ -10,3 +10,13 @@ bar x =
|
||||
else case x of
|
||||
1 -> 10
|
||||
_ -> 20
|
||||
|
||||
baz :: Int -> Bar
|
||||
baz x =
|
||||
if x > 5
|
||||
then
|
||||
\case
|
||||
Foo -> bar
|
||||
else
|
||||
do
|
||||
undefined
|
||||
|
@ -540,14 +540,12 @@ p_hsExpr = \case
|
||||
breakpoint
|
||||
inci $ do
|
||||
txt "then"
|
||||
located then' $ \x -> do
|
||||
breakpoint
|
||||
inci (p_hsExpr x)
|
||||
located then' $ \x ->
|
||||
placeHanging (exprPlacement x) (p_hsExpr x)
|
||||
breakpoint
|
||||
txt "else"
|
||||
located else' $ \x -> do
|
||||
breakpoint
|
||||
inci (p_hsExpr x)
|
||||
located else' $ \x ->
|
||||
placeHanging (exprPlacement x) (p_hsExpr x)
|
||||
HsMultiIf NoExt guards -> do
|
||||
txt "if"
|
||||
breakpoint
|
||||
|
Loading…
Reference in New Issue
Block a user