@@ -1,4 +1,3 @@
1−{-# LANGUAGE LambdaCase #-}
21{-# LANGUAGE OverloadedStrings #-}
32{-# LANGUAGE RecordWildCards #-}
43
@@ -9,20 +8,17 @@ module Ormolu.Printer.Meat.Module
98 )
109where
1110
12−import BasicTypes hiding (InlinePragma)
1311import Control.Monad
1412import Data.Maybe (isJust)
15−import Data.Text (Text)
1613import GHC
1714import Ormolu.Imports
1815import Ormolu.Printer.Combinators
1916import Ormolu.Printer.Comments
2017import Ormolu.Printer.Meat.Common
2118import Ormolu.Printer.Meat.Declaration
19+import Ormolu.Printer.Meat.Declaration.Warning
2220import Ormolu.Printer.Meat.ImportExport
23−import Ormolu.Utils
2421import SrcLoc (combineSrcSpans)
25−import qualified Data.List.NonEmpty as NE
2622
2723p_hsModule :: ParsedSource -> R ()
2824p_hsModule loc@(L moduleSpan hsModule) = do
@@ -38,7 +34,7 @@ p_hsModule loc@(L moduleSpan hsModule) = do
3834 Nothing -> pure ()
3935 Just hsmodName' -> line $ do
4036 located hsmodName' p_hsmodName
41− forM_ hsmodDeprecMessage (located' p_warningTxt)
37+ forM_ hsmodDeprecMessage (located' p_moduleWarning)
4238 case hsmodExports of
4339 Nothing -> return ()
4440 Just hsmodExports' -> do
@@ -53,23 +49,3 @@ p_hsModule loc@(L moduleSpan hsModule) = do
5349 trailingComments <- hasMoreComments
5450 when (trailingComments && isJust hsmodName) newline
5551 spitRemainingComments
56−
57−-- | Layout the WARNING\/DEPRECATED pragmas in the module head.
58−
59−p_warningTxt :: WarningTxt -> R ()
60−p_warningTxt = \case
61− WarningTxt _ lits -> p_pragma "WARNING" lits
62− DeprecatedTxt _ lits -> p_pragma "DEPRECATED" lits
63− where
64− p_pragma :: Text -> [Located StringLiteral] -> R ()
65− p_pragma pragmaText lits = switchLayout (litsSpan lits) $ do
66− breakpoint
67− inci $ pragma pragmaText (p_lits lits)
68−
69− litsSpan :: [Located StringLiteral] -> SrcSpan
70− litsSpan lits = combineSrcSpans' (getLoc <$> NE.fromList lits)
71−
72− p_lits :: [Located StringLiteral] -> R ()
73− p_lits = \case
74− [l] -> atom l
75− ls -> brackets . velt $ withSep comma atom ls