Expand description
The parser module contains the full implementation of the parser combinator library.
It exposes all core parser traits, combinators, and utilities for constructing complex parsers from simple building blocks.
Modules§
- and
- Parsers that combine multiple conditions (AND combinators).
- between
- Parsers that match between two delimiters. Useful for bracketed or quoted sections.
- bind
- Parsers allowing binding transformations of output.
- core
- Core parser components and traits.
- debug
- Debugging parsers that print trace information for parser steps.
- delim
- Parsers handling delimiters, useful for parsing delimited lists or tokens.
- fold_
left - Folding the result of parser into a single value
- ident
- Parsers specifically for identifiers.
- ignore_
then - Parsing two parsers in sequences ignoring the result of the first
- into
- Conversions from input types (like slices, strings) into specified tokens.
- macros
- many
- Parsers for matching between
at_leastandat_mostrepetitions of a pattern. - map_
error - Map result of parser if it is an error
- map_
with_ span - Map result of parser with the input span it parsed
- not
- Negative lookahead parser combinators, succeed if the inner parser fails at current input.
- or
- Choice combinators allowing trying multiple parsers in sequence, succeeding on the first successful parser.
- padded
- Parsers that handle padding around other parsers, such as whitespace or delimiters before and after.
- recursive
- Recursive parser combinators allowing parsers to reference themselves, useful for parsing recursive grammars.
- sat
- Parsers that match tokens satisfying predicates. Useful for matching specific token classes.
- seq
- Parsing multiple parsers one after the other.
- then_
ignore - Parsing two parsers in sequences ignore the result of the second
- until_
end - Parser that asserts if an inner parser has consumed all input.
- utils
- Utility functions and helpers used internally by parsers.
Functions§
- any
- Creates a parser that accepts any token.
- just
- Creates a parser that matches exactly one token equal to
t. - pinlinews
- Creates a parser that accepts any inline ASCII whitespace token. Meaning no newline tokens.
- pletter
- Creates a parser that accepts any ASCII alphabetic letter token.
- pnum
- Creates a parser that accepts any numeric ASCII digit token.
- pws
- Creates a parser that accepts any ASCII whitespace token.