Shorthand for P[Unit]
Parses a single character, any character, as long as there is at least one character for it to parse (i.e.
Parses a single character, any character, as long as there is at least one character for it to parse (i.e. the input isn't at its end)
Parser that is only successful at the end of the input.
Parser that is only successful at the end of the input. Useful to ensure your parser parses the whole file.
No-op parser with a custom error message that always fails, consuming zero characters
No-op parser that always fails, consuming zero characters
Parses a string value case-insensitively
Parser that always succeeds and returns the current index into the parsed input.
Parser that always succeeds and returns the current index into the parsed input. Useful for e.g. capturing source locations so when downstream valiation raises errors you can tell the user where in the input the error originated from
Allows backtracking regardless of whether cuts happen within the wrapped parser; this is useful for re-using an existing parser with cuts within it, in other parts of your grammar where backtracking is necessary and unavoidable.
Wraps a parser and ensures that none of the parsers within it leave failure traces in terminalMsgs, though unlike ByNameOps.opaque if there is a failure *within* the wrapped parser the failure's location and error message will still be shown
Wraps a parser and ensures that none of the parsers within it leave failure traces in terminalMsgs, though unlike ByNameOps.opaque if there is a failure *within* the wrapped parser the failure's location and error message will still be shown
Useful for wrapping things like whitespace, code-comment, etc. parsers which can be applied everywhere and are not useful to display to the user as part of the error message.
No-op parser that always succeeds with the given value, consuming zero characters
No-op parser that always succeeds, consuming zero characters
Like AnyChar, but returns the single character it parses.
Like AnyChar, but returns the single character it parses. Useful
together with EagerOps.flatMapX to provide one-character-lookahead
style parsing: SingleChar consumes the single character, and then
EagerOps.flatMapX can match
on that single character and decide
which downstream parser you wish to invoke
Parser that is only successful at the start of the input.
Parses the given input ParserInput using the given parser and returns a Parsed result containing the success value or failure metadata.
Parses the given input ParserInput using the given parser and returns a Parsed result containing the success value or failure metadata.
Can take either a String, an Iterator or strings or a fastparse.ParserInput object
the input to parse
the parser method to use to parse the input
enable this to show a more detailed error message
if a parser fails, without needing to run
.traced.trace
. Defaults to false
as it slows
down parsing considerably
where in the input to start parsing
Callbacks that get run before and after every named
P(...)
parser