Used to capture the text parsed by this as a String
Used to capture the text parsed by this as a String
Parses this, optionally
Parses this, optionally
Uses the result of this parser to create another parser that will be used for the next parse
Uses the result of this parser to create another parser that will be used for the next parse
Wraps this in a Logged.
Wraps this in a Logged. This prints out information where a parser was tried and its result, which is useful for debugging
Transforms the result of this Parser with the given function
Transforms the result of this Parser with the given function
Parses the given input
starting from the given index
Parses the given input
starting from the given index
The string we want to parse
The index in the string to start from. By default parsing starts from the beginning of a string, but you can start from halfway through the string if you want.
Whether or not you want a full trace of any error messages
that appear. Without it, you only get the single deepest
parser in the call-stack when it failed, and its index. With
trace
, you get every parser all the way to the top, though
this comes with a ~20-40% slowdown.
Allows you to pass in a callback that will get called by every named rule, its index, as it itself given a callback that can be used to recurse into the parse and return the result. Very useful for extracting auxiliary information from the parse, e.g. counting rule invocations to locate bottlenecks or unwanted backtracking in the parser.
Parses the given input
starting from the given index
and logDepth
Parses the given input
starting from the given index
and logDepth
Repeats this parser 0 or more times
Repeats this parser 0 or more times
Whether or not this parser should show up when Failure.trace is called
Whether or not this parser should show up when Failure.trace is called
Wraps this in a Not for negative lookaheak
Wraps this in a Not for negative lookaheak
Parses using this or the parser p
Parses using this or the parser p
Parses using this followed by the parser p
Parses using this followed by the parser p
Performs a cut if this parses successfully.
Performs a cut if this parses successfully.
Parses using this followed by the parser p
, performing a Cut if
this parses successfully.
Parses using this followed by the parser p
, performing a Cut if
this parses successfully. That means that if p
fails to parse, the
parse will fail immediately and not backtrack past this success.
This lets you greatly narrow the error position by avoiding unwanted backtracking.
Parses a single character if it passes the predicate