Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
FreeC.Util.Parsec
Contents
Description
This module contains utility functions for working with the Parsec library.
Synopsis
- parsecErrorToMessage :: SrcFileMap -> ParseError -> Message
- reportParsecError :: MonadReporter r => SrcFileMap -> ParseError -> r a
- runParsecOrFail :: MonadReporter r => SrcFile -> [t] -> Parsec [t] () a -> r a
Documentation
parsecErrorToMessage :: SrcFileMap -> ParseError -> Message Source #
Converts a ParseError
to an error Message
.
The error message can quote source code from the given source files.
reportParsecError :: MonadReporter r => SrcFileMap -> ParseError -> r a Source #
Reports a fatal ParseError
.
The error message can quote source code from the given source files.
Arguments
:: MonadReporter r | |
=> SrcFile | The file to parse. |
-> [t] | The token stream to parse. |
-> Parsec [t] () a | The parser to run. |
-> r a |
Runs the given parser on the given input and reports a fatal error if there is a parse error.
Orphan instances
ConvertibleSrcSpan SourcePos Source # | |
Methods convertSrcSpan :: SrcFileMap -> SourcePos -> SrcSpan Source # |