1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-27 13:13:23 +03:00

Hang after block arguments

This commit is contained in:
Utku Demir 2019-08-16 12:24:34 +12:00 committed by Mark Karpov
parent 682a5f4672
commit 118558738b
3 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,24 @@
f1 = foo do bar
f2 =
foo do
bar
f3 =
foo case True of
True -> bar
False -> baz
f4 = foo let a = 3 in b
f5 =
foo
let a = 3
b = a
in b
f6 =
foo
if bar
then baz
else not baz

View File

@ -0,0 +1,18 @@
f1 = foo do bar
f2 = foo do
bar
f3 = foo case True of
True -> bar
False -> baz
f4 = foo let a = 3 in b
f5 = foo let a = 3
b = a
in b
f6 = foo if bar
then baz
else not baz

View File

@ -470,8 +470,9 @@ p_hsExpr = \case
inci (p_matchGroup LambdaCase mgroup)
HsApp NoExt f x -> sitcc $ do
located f p_hsExpr
breakpoint
inci (located x p_hsExpr)
-- Second argument can be a `do` or `case` block with `-XBlockArguments`.
placeHanging (exprPlacement (unLoc x)) $
located x p_hsExpr
HsAppType a e -> do
located e p_hsExpr
breakpoint