[][src]Enum macro_railroad::lowering::Matcher

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>,
        seperator: Option<String>,
    },
    NonTerminal {
        name: String,
        fragment: Fragment,
    },
}

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

Fields of Repeat

content: Box<Matcher>seperator: Option<String>
NonTerminal

Fields of NonTerminal

name: Stringfragment: Fragment

Implementations

impl Matcher[src]

pub fn accept_mut(&mut self, visitor: &mut impl TransformVisitor)[src]

pub fn accept(&self, visitor: &mut impl InspectVisitor)[src]

pub fn any<F: FnMut(&Self) -> bool>(&self, predicate: F) -> bool[src]

pub fn contains(&self, needle: &Matcher) -> bool[src]

Trait Implementations

impl Clone for Matcher[src]

impl Debug for Matcher[src]

impl Eq for Matcher[src]

impl From<Matcher> for Matcher[src]

impl From<Rule> for Matcher[src]

impl Hash for Matcher[src]

impl Ord for Matcher[src]

impl PartialEq<Matcher> for Matcher[src]

impl PartialOrd<Matcher> for Matcher[src]

impl StructuralEq for Matcher[src]

impl StructuralPartialEq for Matcher[src]

Auto Trait Implementations

impl RefUnwindSafe for Matcher

impl Send for Matcher

impl Sync for Matcher

impl Unpin for Matcher

impl UnwindSafe for Matcher

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.