Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.PureScript.CST
Synopsis
- parseFromFile :: FilePath -> Text -> ([ParserWarning], Either (NonEmpty ParserError) Module)
- parseFromFiles :: MonadError MultipleErrors m => (k -> FilePath) -> [(k, Text)] -> m [(k, ([ParserWarning], Module))]
- parseModuleFromFile :: FilePath -> Text -> Either (NonEmpty ParserError) (PartialResult Module)
- parseModulesFromFiles :: MonadError MultipleErrors m => (k -> FilePath) -> [(k, Text)] -> m [(k, PartialResult Module)]
- unwrapParserError :: MonadError MultipleErrors m => FilePath -> Either (NonEmpty ParserError) a -> m a
- toMultipleErrors :: FilePath -> NonEmpty ParserError -> MultipleErrors
- toMultipleWarnings :: FilePath -> [ParserWarning] -> MultipleErrors
- toPositionedError :: FilePath -> ParserError -> ErrorMessage
- toPositionedWarning :: FilePath -> ParserWarning -> ErrorMessage
- pureResult :: a -> PartialResult a
- module Language.PureScript.CST.Convert
- module Language.PureScript.CST.Errors
- module Language.PureScript.CST.Lexer
- type LexResult = Either (LexState, ParserError) SourceToken
- type Parser = ParserM ParserError ParserState
- newtype ParserM e s a = Parser (forall r. s -> (s -> e -> r) -> (s -> a -> r) -> r)
- runParser :: ParserState -> Parser a -> (ParserState, Either (NonEmpty ParserError) a)
- data ParserState = ParserState {
- parserBuff :: [LexResult]
- parserErrors :: [ParserError]
- parserWarnings :: [ParserWarning]
- runTokenParser :: Parser a -> [LexResult] -> Either (NonEmpty ParserError) ([ParserWarning], a)
- module Language.PureScript.CST.Parser
- module Language.PureScript.CST.Print
- module Language.PureScript.CST.Types
Documentation
parseFromFile :: FilePath -> Text -> ([ParserWarning], Either (NonEmpty ParserError) Module) #
parseFromFiles :: MonadError MultipleErrors m => (k -> FilePath) -> [(k, Text)] -> m [(k, ([ParserWarning], Module))] #
parseModuleFromFile :: FilePath -> Text -> Either (NonEmpty ParserError) (PartialResult Module) #
parseModulesFromFiles :: MonadError MultipleErrors m => (k -> FilePath) -> [(k, Text)] -> m [(k, PartialResult Module)] #
unwrapParserError :: MonadError MultipleErrors m => FilePath -> Either (NonEmpty ParserError) a -> m a #
toMultipleWarnings :: FilePath -> [ParserWarning] -> MultipleErrors #
toPositionedError :: FilePath -> ParserError -> ErrorMessage #
pureResult :: a -> PartialResult a #
type LexResult = Either (LexState, ParserError) SourceToken #
type Parser = ParserM ParserError ParserState #
A bare bones, CPS'ed `StateT s (Except e) a`.
Constructors
Parser (forall r. s -> (s -> e -> r) -> (s -> a -> r) -> r) |
Instances
Applicative (ParserM e s) # | |
Defined in Language.PureScript.CST.Monad | |
Functor (ParserM e s) # | |
Monad (ParserM e s) # | |
runParser :: ParserState -> Parser a -> (ParserState, Either (NonEmpty ParserError) a) #
data ParserState #
Constructors
ParserState | |
Fields
|
Instances
Show ParserState # | |
Defined in Language.PureScript.CST.Monad Methods showsPrec :: Int -> ParserState -> ShowS # show :: ParserState -> String # showList :: [ParserState] -> ShowS # |
runTokenParser :: Parser a -> [LexResult] -> Either (NonEmpty ParserError) ([ParserWarning], a) #