pub enum Matcher {
Choice(Vec<Matcher>),
Comment(String),
Empty,
InternalMacroHint,
Group(Box<Matcher>),
Literal(String),
Optional(Box<Matcher>),
Sequence(Vec<Matcher>),
Repeat {
content: Box<Matcher>,
separator: Option<String>,
},
NonTerminal {
name: String,
fragment: Fragment,
},
}Expand description
A more coarse superset of parser::Matcher.
Some variants of parser::Matcher share the same representation here.
Variants like Empty or Comment are not produced by parser::Matcher
but due to transformations applied in this module.
Variants§
Choice(Vec<Matcher>)
Comment(String)
Empty
InternalMacroHint
Group(Box<Matcher>)
Literal(String)
Optional(Box<Matcher>)
Sequence(Vec<Matcher>)
Repeat
NonTerminal
Implementations§
Trait Implementations§
impl Eq for Matcher
Source§impl Ord for Matcher
impl Ord for Matcher
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Matcher
impl PartialOrd for Matcher
impl StructuralPartialEq for Matcher
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
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