mirror of
https://github.com/google/ormolu.git
synced 2024-12-02 23:43:34 +03:00
Support single line where clauses
This commit is contained in:
parent
0baa898f30
commit
b2f49a7693
@ -1,7 +1,5 @@
|
||||
foo :: Int -> Int
|
||||
foo x = f x
|
||||
where
|
||||
f z = z
|
||||
foo x = f x where f z = z
|
||||
|
||||
bar :: Int -> Int
|
||||
bar x = f x
|
||||
|
@ -200,11 +200,13 @@ p_match' placer pretty style isInfix strictness m_pats m_grhss = do
|
||||
then RightArrow
|
||||
else EqualSign
|
||||
newlineSep (located' (p_grhs' pretty groupStyle)) grhssGRHSs
|
||||
let whereLocation = combineSrcSpans patGrhssSpan $ getLoc grhssLocalBinds
|
||||
unless
|
||||
(GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds))
|
||||
(inciLocalBinds $ do
|
||||
newline
|
||||
line (txt "where")
|
||||
(inciLocalBinds . switchLayout whereLocation $ do
|
||||
breakpoint
|
||||
txt "where"
|
||||
breakpoint
|
||||
inci (located grhssLocalBinds p_hsLocalBinds)
|
||||
)
|
||||
case style of
|
||||
|
Loading…
Reference in New Issue
Block a user