{-# LANGUAGE RecordWildCards #-}
module Ormolu.Parser.Result
( ParseResult (..),
prettyPrintParseResult,
)
where
import GHC
import Ormolu.Parser.Anns
import Ormolu.Parser.CommentStream
import Ormolu.Parser.Pragma (Pragma)
data ParseResult
= ParseResult
{
prParsedSource :: ParsedSource,
prAnns :: Anns,
prCommentStream :: CommentStream,
prExtensions :: [Pragma],
prShebangs :: [Located String],
prUseRecordDot :: Bool
}
prettyPrintParseResult :: ParseResult -> String
prettyPrintParseResult ParseResult {..} =
unlines
[ "parse result:",
" comment stream:",
showCommentStream prCommentStream
]