Expand description
Parser primitives that accept specific token patterns.
“These creatures you call mice, you see, they are not quite as they appear. They are merely the protrusion into our dimension of vastly hyperintelligent pandimensional beings.”
Chumsky parsers are created by combining together smaller parsers. Right at the bottom of the pile are the parser primitives, a parser developer’s bread & butter. Each of these primitives are very easy to understand in isolation, usually only doing one thing.
§The Important Ones
Structs§
- Any
- See
any. - AnyRef
- See
any_ref. - Choice
- See
choice. - Custom
- See
custom. - Empty
- See
empty. - End
- See
end. - Group
- See
group. - Just
- See
just. - JustCfg
- Configuration for
just, used inConfigParser::configure - MapCtx
- See
map_ctx. - NoneOf
- See
none_of. - OneOf
- See
one_of. - OneOf
Cfg - Configuration for
one_of, used inConfigParser::configure - Select
- See
select!. - Select
Ref - See
select_ref!. - Set
- See
set. - Todo
- See
todo.
Functions§
- any
- A parser that accepts any input (but not the end of input).
- any_ref
- A parser that accepts any input (but not the end of input).
- choice
- Parse using a tuple of many parsers, producing the output of the first to successfully parse.
- custom
- Declare a parser that uses custom imperative parsing logic.
- empty
- A parser that parses no inputs.
- end
- A parser that accepts only the end of input.
- group
- Parse using a tuple of many parsers, producing a tuple of outputs if all successfully parse, otherwise returning an error if any parsers fail.
- just
- A parser that accepts only the given input.
- map_ctx
- Apply a mapping function to the context of this parser.
- none_of
- A parser that accepts any input that is not in a sequence of specific inputs.
- one_of
- A parser that accepts one of a sequence of specific inputs.
- select
- See
select!. - select_
ref - See
select_ref!. - set
- Parse using a tuple of parsers in any order, producing the output of the parser set in the provided order.
- todo
- A parser that can be used wherever you need to implement a parser later.