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 :: Int -> Int
|
||||||
foo x = f x
|
foo x = f x where f z = z
|
||||||
where
|
|
||||||
f z = z
|
|
||||||
|
|
||||||
bar :: Int -> Int
|
bar :: Int -> Int
|
||||||
bar x = f x
|
bar x = f x
|
||||||
|
@ -200,11 +200,13 @@ p_match' placer pretty style isInfix strictness m_pats m_grhss = do
|
|||||||
then RightArrow
|
then RightArrow
|
||||||
else EqualSign
|
else EqualSign
|
||||||
newlineSep (located' (p_grhs' pretty groupStyle)) grhssGRHSs
|
newlineSep (located' (p_grhs' pretty groupStyle)) grhssGRHSs
|
||||||
|
let whereLocation = combineSrcSpans patGrhssSpan $ getLoc grhssLocalBinds
|
||||||
unless
|
unless
|
||||||
(GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds))
|
(GHC.isEmptyLocalBindsPR (unLoc grhssLocalBinds))
|
||||||
(inciLocalBinds $ do
|
(inciLocalBinds . switchLayout whereLocation $ do
|
||||||
newline
|
breakpoint
|
||||||
line (txt "where")
|
txt "where"
|
||||||
|
breakpoint
|
||||||
inci (located grhssLocalBinds p_hsLocalBinds)
|
inci (located grhssLocalBinds p_hsLocalBinds)
|
||||||
)
|
)
|
||||||
case style of
|
case style of
|
||||||
|
Loading…
Reference in New Issue
Block a user