Expand description
Core parser types.
Structs
A self-describing parser combinator.
Enums
Either left or right. Used for parsers that can return either of two types of output.
Functions
Applies the parser any number of times.
Apply open, then between, then close.
Parses any character. Always succeeds.
Applies the parsers in the slice until one succeeds.
Parses a single base ten digit.
Applies the first parser, and if it fails, applies the second one.
Outputs an Either
on success.
Succeeds when the input is empty.
Call a function on the input, and if it returns false
,
throw an error.
Fail with a message.
Applies all the given parsers and picks the one which consumes the most input. Doesn’t consume any input on partial failure.
Silence a parser. Discard its output and return ()
instead.
Positive or negative integer.
Parses a string literal.
Parses a single letter.
Parses a single line-feed token.
Applies the parser one or more times.
Natural number.
Tries to apply the parser. Outputs an Option
with None
if it failed to apply the parser
and no input was consumed, and Some
if it succeeded. Outputs an error if some but not all
input was consumed.
Apply the given parser, and if it fails, don’t consume any input.
Pretty print an input string.
Rational number.
Call the given predicate on the next character. If it returns true
,
consume the character.
Like keyword
, but constrained to String
outputs.
Parses a single character.
Apply the parser until the other parser succeeds.
Spaces.