Skip to content

Commit

Permalink
Move LocatedL into p_hsmodExports
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Nov 15, 2022
1 parent 3189dd0 commit 317a0fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
17 changes: 9 additions & 8 deletions src/Ormolu/Printer/Meat/ImportExport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ import Ormolu.Printer.Combinators
import Ormolu.Printer.Meat.Common
import Ormolu.Utils (RelativePos (..), attachRelativePos)

p_hsmodExports :: [LIE GhcPs] -> R ()
p_hsmodExports xs =
parens N $ do
layout <- getLayout
sep
breakpoint
(\(p, l) -> sitcc (located l (p_lie layout p)))
(attachRelativePos xs)
p_hsmodExports :: LocatedL [LIE GhcPs] -> R ()
p_hsmodExports lexports =
located lexports $ \exports ->
inci . parens N $ do
layout <- getLayout
sep
breakpoint
(\(p, l) -> sitcc (located l (p_lie layout p)))
(attachRelativePos exports)

p_hsmodImport :: ImportDecl GhcPs -> R ()
p_hsmodImport ImportDecl {..} = do
Expand Down
5 changes: 1 addition & 4 deletions src/Ormolu/Printer/Meat/Module.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ p_hsModule mstackHeader pragmas HsModule {..} = do
breakpoint
case hsmodExports of
Nothing -> return ()
Just l -> do
located l $ \exports -> do
inci (p_hsmodExports exports)
breakpoint
Just exports -> p_hsmodExports exports >> breakpoint
txt "where"
newline
newline
Expand Down

0 comments on commit 317a0fc

Please sign in to comment.