Skip to main content

Crate tecta_peg

Crate tecta_peg 

Source

Structs§

Control
A transient control rule; cleared by other control characters.
Error
The error type.
Keywords
A #keywords preamble.
ParseInput
Input to a PEG parsing function.
PegStack
A PEG grammar stack.
Preambles
The set of preambles.
RepeatRule
Repeats a rule a number of times, the repetition choice being decided by the operator used:
Rule
A grammar rule.
SpannedChars
Wraps a character iterator, adding span information to each character.
TectaPegModule
A TECTA PEG module.

Enums§

AnyDelimiter
A delimiter of a group in a token tree, or a sequence.
AtLeast
At least some number of times.
ControlKind
A specific variant of control rule.
KeywordHardness
The hardness of a keyword.
KeywordList
A keyword list; part of the #keywords preamble.
Peg
An element of a PEG grammar stack.
RuleKind
A specific grammar rule variant.
RuleStatus
Whether or not rule parsing should continue.

Functions§

consume_identifier_rest
After parsing the first character of an identifier, this can be used to parse the rest of the characters.
expect_exactly
Expects some literal text content to appear in the character stream.
expect_identifier
Attempts to parse an identifier. If already at EOF, Ok(None) is returned.
identifier_or_eof
Similar to expect_identifier, but errors on EOF.
next_rule
Parses the next rule, modifying the stack accordingly. Returns whether or not rule parsing should continue.
parse_basic_identifier_list
Parses a list of identifiers.
parse_module
Parses a TECTA PEG module from a string. See parse_module.
parse_module_inner
Parses a TECTA PEG module; a set of preambles and rule definitions.
parse_single_grammar
Parses a full grammar; creates a new stack and calls next_rule repeatedly until no control grammars are on the stack and the stack is not empty.
skip_ws
Skips over as many whitespace characters as possible.

Type Aliases§

Result