Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Persist.Quasi.Internal.ModelParser
Synopsis
- data SourceLoc = SourceLoc {
- locFile :: Text
- locStartLine :: Int
- locStartCol :: Int
- data Token
- tokenContent :: Token -> Text
- anyToken :: Parser Token
- data ParsedEntityDef
- parsedEntityDefComments :: ParsedEntityDef -> [Text]
- parsedEntityDefEntityName :: ParsedEntityDef -> EntityNameHS
- parsedEntityDefIsSum :: ParsedEntityDef -> Bool
- parsedEntityDefEntityAttributes :: ParsedEntityDef -> [Attr]
- parsedEntityDefFieldAttributes :: ParsedEntityDef -> [([Token], Maybe Text)]
- parsedEntityDefExtras :: ParsedEntityDef -> Map Text [ExtraLine]
- parsedEntityDefSpan :: ParsedEntityDef -> Maybe SourceSpan
- parseSource :: PersistSettings -> Maybe SourceLoc -> Text -> ParseResult [ParsedEntityDef]
- memberBlockAttrs :: Member -> [BlockAttr]
- data ParserWarning
- parserWarningMessage :: ParserWarning -> String
- type ParseResult a = (Set ParserWarning, Either (ParseErrorBundle String Void) a)
- type CumulativeParseResult a = (Set ParserWarning, Either [EntityParseError] a)
- toCumulativeParseResult :: Monoid a => [ParseResult a] -> CumulativeParseResult a
- renderErrors :: [EntityParseError] -> String
- runConfiguredParser :: PersistSettings -> ExtraState -> Parser a -> String -> String -> InternalParseResult a
- data ParserErrorLevel
- initialExtraState :: ExtraState
Documentation
Source location: file and line/col information. This is half of a SourceSpan
.
Since: 2.16.0.0
Constructors
SourceLoc | |
Fields
|
tokenContent :: Token -> Text Source #
Converts a token into a Text representation for second-stage parsing or presentation to the user
Since: 2.16.0.0
data ParsedEntityDef Source #
Instances
Show ParsedEntityDef Source # | |
Defined in Database.Persist.Quasi.Internal.ModelParser Methods showsPrec :: Int -> ParsedEntityDef -> ShowS # show :: ParsedEntityDef -> String # showList :: [ParsedEntityDef] -> ShowS # |
parsedEntityDefFieldAttributes :: ParsedEntityDef -> [([Token], Maybe Text)] Source #
parseSource :: PersistSettings -> Maybe SourceLoc -> Text -> ParseResult [ParsedEntityDef] Source #
memberBlockAttrs :: Member -> [BlockAttr] Source #
Represents an entity member as a list of BlockAttrs
Since: 2.16.0.0
data ParserWarning Source #
Since: 2.16.0.0
Instances
Show ParserWarning Source # | |
Defined in Database.Persist.Quasi.PersistSettings.Internal Methods showsPrec :: Int -> ParserWarning -> ShowS # show :: ParserWarning -> String # showList :: [ParserWarning] -> ShowS # | |
Eq ParserWarning Source # | |
Defined in Database.Persist.Quasi.PersistSettings.Internal Methods (==) :: ParserWarning -> ParserWarning -> Bool # (/=) :: ParserWarning -> ParserWarning -> Bool # | |
Ord ParserWarning Source # | |
Defined in Database.Persist.Quasi.PersistSettings.Internal Methods compare :: ParserWarning -> ParserWarning -> Ordering # (<) :: ParserWarning -> ParserWarning -> Bool # (<=) :: ParserWarning -> ParserWarning -> Bool # (>) :: ParserWarning -> ParserWarning -> Bool # (>=) :: ParserWarning -> ParserWarning -> Bool # max :: ParserWarning -> ParserWarning -> ParserWarning # min :: ParserWarning -> ParserWarning -> ParserWarning # |
parserWarningMessage :: ParserWarning -> String Source #
Uses errorBundlePretty
to render a parser warning.
Since: 2.16.0.0
type ParseResult a = (Set ParserWarning, Either (ParseErrorBundle String Void) a) Source #
Result of parsing a single source text.
Since: 2.16.0.0
type CumulativeParseResult a = (Set ParserWarning, Either [EntityParseError] a) Source #
Cumulative result of parsing multiple source texts.
Since: 2.16.0.0
toCumulativeParseResult :: Monoid a => [ParseResult a] -> CumulativeParseResult a Source #
renderErrors :: [EntityParseError] -> String Source #
Renders a list of EntityParseErrors as a String using errorBundlePretty
,
separated by line breaks.
@since 2.16.0.0
runConfiguredParser :: PersistSettings -> ExtraState -> Parser a -> String -> String -> InternalParseResult a Source #
Run a parser using provided PersistSettings and ExtraState @since 2.16.0.0
data ParserErrorLevel Source #
Since: 2.16.0.0
Constructors
LevelError | |
LevelWarning |
Instances
Show ParserErrorLevel Source # | |
Defined in Database.Persist.Quasi.PersistSettings.Internal Methods showsPrec :: Int -> ParserErrorLevel -> ShowS # show :: ParserErrorLevel -> String # showList :: [ParserErrorLevel] -> ShowS # | |
Eq ParserErrorLevel Source # | |
Defined in Database.Persist.Quasi.PersistSettings.Internal Methods (==) :: ParserErrorLevel -> ParserErrorLevel -> Bool # (/=) :: ParserErrorLevel -> ParserErrorLevel -> Bool # |
initialExtraState :: ExtraState Source #