| Copyright | © 2015–2018 Megaparsec contributors |
|---|---|
| License | FreeBSD |
| Maintainer | Mark Karpov <markkarpov92@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Text.Megaparsec.Error.Builder
Description
A set of helpers that should make construction of ParseErrors more
concise. This is primarily useful in test suites and for debugging.
Since: 6.0.0
- err :: Int -> ET s -> ParseError s e
- errFancy :: Int -> EF e -> ParseError s e
- utok :: Stream s => Token s -> ET s
- utoks :: forall s. Stream s => Tokens s -> ET s
- ulabel :: Stream s => String -> ET s
- ueof :: Stream s => ET s
- etok :: Stream s => Token s -> ET s
- etoks :: forall s. Stream s => Tokens s -> ET s
- elabel :: Stream s => String -> ET s
- eeof :: Stream s => ET s
- fancy :: ErrorFancy e -> EF e
- data ET s
- data EF e
Top-level helpers
Arguments
| :: Int |
|
| -> ET s | Error components |
| -> ParseError s e | Resulting |
Assemble a ParseError from offset and value. ET t is a
monoid and can be assembled by combining primitives provided by this
module, see below.ET t
Arguments
| :: Int |
|
| -> EF e | Error components |
| -> ParseError s e | Resulting |
Like err, but constructs a “fancy” ParseError.
Error components
utoks :: forall s. Stream s => Tokens s -> ET s #
Construct an “unexpected tokens” error component. Empty chunk produces
EndOfInput.
ulabel :: Stream s => String -> ET s #
Construct an “unexpected label” error component. Do not use with empty strings (for empty strings it's bottom).
etoks :: forall s. Stream s => Tokens s -> ET s #
Construct an “expected tokens” error component. Empty chunk produces
EndOfInput.
elabel :: Stream s => String -> ET s #
Construct an “expected label” error component. Do not use with empty strings.
fancy :: ErrorFancy e -> EF e #
Construct a custom error component.
Data types
Auxiliary type for construction of trivial parse errors.