Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type LexResult = Either (LexState, ParserError) SourceToken
- data LexState = LexState {
- lexPos :: SourcePos
- lexLeading :: [Comment LineFeed]
- lexSource :: Text
- lexStack :: LayoutStack
- data ParserState = ParserState {
- parserBuff :: [LexResult]
- parserErrors :: [ParserError]
- newtype ParserM e s a = Parser (forall r. s -> (s -> e -> r) -> (s -> a -> r) -> r)
- type Parser = ParserM ParserError ParserState
- runParser :: ParserState -> Parser a -> (ParserState, Either (NonEmpty ParserError) a)
- runTokenParser :: Parser a -> [LexResult] -> Either (NonEmpty ParserError) a
- throw :: e -> ParserM e s a
- parseError :: SourceToken -> Parser a
- mkParserError :: LayoutStack -> [SourceToken] -> ParserErrorType -> ParserError
- addFailure :: [SourceToken] -> ParserErrorType -> Parser ()
- addFailures :: [ParserError] -> Parser ()
- parseFail' :: [SourceToken] -> ParserErrorType -> Parser a
- parseFail :: SourceToken -> ParserErrorType -> Parser a
- pushBack :: SourceToken -> Parser ()
- tryPrefix :: Parser a -> Parser b -> Parser (Maybe a, b)
- oneOf :: NonEmpty (Parser a) -> Parser a
- manyDelimited :: Token -> Token -> Token -> Parser a -> Parser [a]
- token :: Token -> Parser SourceToken
- munch :: Parser SourceToken
Documentation
type LexResult = Either (LexState, ParserError) SourceToken Source #
LexState | |
|
data ParserState Source #
ParserState | |
|
Instances
Show ParserState Source # | |
Defined in Language.PureScript.CST.Monad showsPrec :: Int -> ParserState -> ShowS # show :: ParserState -> String # showList :: [ParserState] -> ShowS # |
newtype ParserM e s a Source #
A bare bones, CPS'ed `StateT s (Except e) a`.
Parser (forall r. s -> (s -> e -> r) -> (s -> a -> r) -> r) |
type Parser = ParserM ParserError ParserState Source #
runParser :: ParserState -> Parser a -> (ParserState, Either (NonEmpty ParserError) a) Source #
runTokenParser :: Parser a -> [LexResult] -> Either (NonEmpty ParserError) a Source #
parseError :: SourceToken -> Parser a Source #
mkParserError :: LayoutStack -> [SourceToken] -> ParserErrorType -> ParserError Source #
addFailure :: [SourceToken] -> ParserErrorType -> Parser () Source #
addFailures :: [ParserError] -> Parser () Source #
parseFail' :: [SourceToken] -> ParserErrorType -> Parser a Source #
parseFail :: SourceToken -> ParserErrorType -> Parser a Source #
pushBack :: SourceToken -> Parser () Source #