{-# LANGUAGE RecordWildCards #-}
module Ormolu.Parser.Result
( ParseResult (..),
prettyPrintParseResult,
)
where
import Data.Text (Text)
import GHC
import Ormolu.Parser.Anns
import Ormolu.Parser.CommentStream
import Ormolu.Parser.Pragma (Pragma)
import Ormolu.Parser.Shebang (Shebang)
data ParseResult = ParseResult
{
ParseResult -> HsModule GhcPs
prParsedSource :: HsModule GhcPs,
ParseResult -> Anns
prAnns :: Anns,
:: Maybe (RealLocated Comment),
ParseResult -> [Shebang]
prShebangs :: [Shebang],
ParseResult -> [([RealLocated Comment], Pragma)]
prPragmas :: [([RealLocated Comment], Pragma)],
:: CommentStream,
ParseResult -> Bool
prUseRecordDot :: Bool,
ParseResult -> Bool
prImportQualifiedPost :: Bool,
ParseResult -> Text
prLiteralPrefix :: Text,
ParseResult -> Text
prLiteralSuffix :: Text,
ParseResult -> Int
prIndent :: Int
}
prettyPrintParseResult :: ParseResult -> String
prettyPrintParseResult :: ParseResult -> String
prettyPrintParseResult ParseResult {Bool
Int
[([RealLocated Comment], Pragma)]
[Shebang]
Maybe (RealLocated Comment)
Text
HsModule GhcPs
Anns
CommentStream
prIndent :: Int
prLiteralSuffix :: Text
prLiteralPrefix :: Text
prImportQualifiedPost :: Bool
prUseRecordDot :: Bool
prCommentStream :: CommentStream
prPragmas :: [([RealLocated Comment], Pragma)]
prShebangs :: [Shebang]
prStackHeader :: Maybe (RealLocated Comment)
prAnns :: Anns
prParsedSource :: HsModule GhcPs
prIndent :: ParseResult -> Int
prLiteralSuffix :: ParseResult -> Text
prLiteralPrefix :: ParseResult -> Text
prImportQualifiedPost :: ParseResult -> Bool
prUseRecordDot :: ParseResult -> Bool
prCommentStream :: ParseResult -> CommentStream
prPragmas :: ParseResult -> [([RealLocated Comment], Pragma)]
prShebangs :: ParseResult -> [Shebang]
prStackHeader :: ParseResult -> Maybe (RealLocated Comment)
prAnns :: ParseResult -> Anns
prParsedSource :: ParseResult -> HsModule GhcPs
..} =
[String] -> String
unlines
[ String
"parse result:",
String
" comment stream:",
CommentStream -> String
showCommentStream CommentStream
prCommentStream
]