ormolu-0.7.4.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Parser.Result

Description

A type for result of parsing.

Synopsis

- data SourceSnippet
  - = RawSnippet Text
  - | ParsedSnippet ParseResult
- data ParseResult = ParseResult {
  - prParsedSource :: HsModule GhcPs
  - prSourceType :: SourceType
  - prStackHeader :: Maybe LComment
  - prPragmas :: [([LComment], Pragma)]
  - prCommentStream :: CommentStream
  - prExtensions :: EnumSet Extension
  - prModuleFixityMap :: ModuleFixityMap
  - prIndent :: Int
  }

# Documentation

data SourceSnippet #

Either a `ParseResult`, or a raw snippet.

Constructors

RawSnippet Text |
ParsedSnippet ParseResult |

data ParseResult #

A collection of data that represents a parsed module in Ormolu.

Constructors

ParseResult |
Fields prParsedSource :: HsModule GhcPs Parsed module or signature prSourceType :: SourceType Either regular module or signature file prStackHeader :: Maybe LComment Stack header prPragmas :: [([LComment], Pragma)] Pragmas and the associated comments prCommentStream :: CommentStream Comment stream prExtensions :: EnumSet Extension Enabled extensions prModuleFixityMap :: ModuleFixityMap Fixity map for operators prIndent :: Int Indentation level, can be non-zero in case of region formatting