mirror of
https://github.com/google/ormolu.git
synced 2024-12-02 23:43:34 +03:00
Shift ‘in’ in ‘let’ to the right to allow placing it in do blocks
It is a bit uncommon to format it like this, but this way it can be placed without changes in do blocks as well. I think it's the right way go about that bug.
This commit is contained in:
parent
01486edadb
commit
3d74f2fb53
@ -47,3 +47,8 @@ foo = do
|
||||
print x
|
||||
y <- c
|
||||
print y
|
||||
|
||||
trickyLet = do
|
||||
foo
|
||||
let x = 5
|
||||
in bar x
|
||||
|
@ -46,3 +46,8 @@ foo = do
|
||||
|
||||
y <- c
|
||||
print y
|
||||
|
||||
trickyLet = do
|
||||
foo
|
||||
let x = 5
|
||||
in bar x
|
||||
|
@ -2,11 +2,11 @@ foo :: Int -> Int
|
||||
foo x =
|
||||
let z = y
|
||||
y = x
|
||||
in z + 100
|
||||
in z + 100
|
||||
|
||||
bar :: Int -> Int
|
||||
bar x =
|
||||
let z = y
|
||||
y = x
|
||||
in z +
|
||||
100
|
||||
in z +
|
||||
100
|
||||
|
@ -459,7 +459,7 @@ p_hsExpr = \case
|
||||
HsLet NoExt localBinds e -> do
|
||||
txt "let "
|
||||
sitcc (located localBinds p_hsLocalBinds)
|
||||
breakpoint
|
||||
vlayout space (newline >> space)
|
||||
txt "in "
|
||||
sitcc (located e p_hsExpr)
|
||||
HsDo NoExt ctx es -> do
|
||||
|
Loading…
Reference in New Issue
Block a user