Expand description
This module provides helper types for common grammar idioms/needs, such as:
- Repetition
- Parenthesization, delimiting
- Separation of consecutive items
Structs
Parses a subexpression inside curly braces.
Parses a subexpression inside square brackets.
Always parses succesfully, consuming no tokens. Emits nothing when printed.
Parses an optional expression introduced by a single-token lookahead.
Parses a subexpression inside parentheses.
Parses a given production repeatedly, separated by punctuation.
Optional trailing punctuation is allowed, and the entire token
stream must consist of interleaved representations of T
and P
.
(Thus, this is generally only useful within a delimited group.)
Type Definitions
A convenience type alias for parsing several repeated items with no separator in between.