combinator
This module contains combinators that can be used to directly influence error messages of parsers.
This module contains combinators that can be used to directly influence error messages of parsers.
- Since
3.0.0
Type members
Classlikes
This class exposes helpful combinators that are specialised for generating more helpful errors messages. For a description of why the library is designed in this way, see: the Parsley wiki
This class exposes helpful combinators that are specialised for generating more helpful errors messages. For a description of why the library is designed in this way, see: the Parsley wiki
- Value Params
- con
A conversion (if required) to turn
p
into a parser- p
The parser which serves as the method receiver
- Version
3.0.0
Value members
Concrete methods
This combinator adjusts the error messages that are generated within its scope so that they
happen at the position on entry to the combinator. This is useful if validation work is done
on the output of a parser that may render it invalid, but the error should point to the
beginning of the structure. This combinators effect can be cancelled with [[entrench]]
This combinator adjusts the error messages that are generated within its scope so that they
happen at the position on entry to the combinator. This is useful if validation work is done
on the output of a parser that may render it invalid, but the error should point to the
beginning of the structure. This combinators effect can be cancelled with [[entrench]]
- Value Params
- p
A parser whose error messages should be adjusted
- Since
3.1.0
Sometimes, the error adjustments performed by [[amend]]
should only affect errors generated
within a certain part of a parser and not the whole thing. In this case, entrench
can be used
to protect sub-parsers from having their errors adjusted, providing a much more fine-grained
scope for error adjustment.
Sometimes, the error adjustments performed by [[amend]]
should only affect errors generated
within a certain part of a parser and not the whole thing. In this case, entrench
can be used
to protect sub-parsers from having their errors adjusted, providing a much more fine-grained
scope for error adjustment.
- Value Params
- p
A parser whose error messages should not be adjusted by any surrounding
[[amend]]
- Since
3.1.0
The fail(msgs)
parser consumes no input and fails with msg
as the error message
The fail(msgs)
parser consumes no input and fails with msg
as the error message
- Since
3.0.0