pub enum RuleKind {
Sequence(Vec<Rule>),
Choice(Vec<Rule>),
Group(Delimiter, Box<Rule>),
Repeat(RepeatRule),
Optional(Box<Rule>),
Punctuation(String),
Keyword(String),
Other(String),
Builtin(String),
}Expand description
A specific grammar rule variant.
Variants§
Sequence(Vec<Rule>)
Matches a sequence of rules, one after another.
Choice(Vec<Rule>)
Begins all rules at the same point, using the first one that matches.
Group(Delimiter, Box<Rule>)
Matches inside a token group.
Repeat(RepeatRule)
A repeating rule, delimited with * or +.
Optional(Box<Rule>)
Makes a rule optional (allowed to fail). Delimited with ?.
Punctuation(String)
Matches a punctuation token.
Keyword(String)
Matches a keyword token.
Other(String)
Matches a different rule.
Builtin(String)
Matches a built-in rule (denoted with @).
Implementations§
Trait Implementations§
Source§impl Ord for RuleKind
impl Ord for RuleKind
Source§impl PartialOrd for RuleKind
impl PartialOrd for RuleKind
impl Eq for RuleKind
impl StructuralPartialEq for RuleKind
Auto Trait Implementations§
impl Freeze for RuleKind
impl RefUnwindSafe for RuleKind
impl Send for RuleKind
impl Sync for RuleKind
impl Unpin for RuleKind
impl UnsafeUnpin for RuleKind
impl UnwindSafe for RuleKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more