on master help sign in
Handle inline comments before let correctly
560c498mrkkrp
data/examples/declaration/value/function/let-multi-line-out.hs+6
@@ -10,3 +10,9 @@ bar x =
10 y = x
10 y = x
11 in z +
11 in z +
12 100
12 100
13+
14+inlineComment :: Int -> Int
15+inlineComment =
16+ let {- join -} go = case () of
17+ () -> undefined
18+ in go
data/examples/declaration/value/function/let-multi-line.hs+6
@@ -10,3 +10,9 @@ bar x =
10 y = x
10 y = x
11 in z
11 in z
12 + 100
12 + 100
13+
14+inlineComment :: Int -> Int
15+inlineComment =
16+ let {- join -} go = case () of
17+ () -> undefined
18+ in go
src/Ormolu/Printer/Meat/Declaration/Value.hs+1−1
@@ -392,7 +392,7 @@ p_hsLocalBinds = \case
392 (Left <$> bagToList bag) ++ (Right <$> lsigs)
392 (Left <$> bagToList bag) ++ (Right <$> lsigs)
393 p_item (Left x) = located x p_valDecl'
393 p_item (Left x) = located x p_valDecl'
394 p_item (Right x) = located x p_sigDecl'
394 p_item (Right x) = located x p_sigDecl'
395− newlineSep p_item (sortOn ssStart items)
395+ newlineSep (sitcc . p_item) (sortOn ssStart items)
396 HsValBinds NoExt _ -> notImplemented "HsValBinds"
396 HsValBinds NoExt _ -> notImplemented "HsValBinds"
397 HsIPBinds NoExt _ -> notImplemented "HsIPBinds"
397 HsIPBinds NoExt _ -> notImplemented "HsIPBinds"
398 EmptyLocalBinds NoExt -> return ()
398 EmptyLocalBinds NoExt -> return ()