grit_pattern_matcher::pattern

Trait AstNodePattern

source
pub trait AstNodePattern<Q: QueryContext>:
    Clone
    + Debug
    + Matcher<Q>
    + PatternName
    + Sized {
    const INCLUDES_TRIVIA: bool;

    // Required methods
    fn children<'a>(
        &'a self,
        definitions: &'a StaticDefinitions<'_, Q>,
    ) -> Vec<PatternOrPredicate<'a, Q>>;
    fn matches_kind_of(&self, node: &Q::Node<'_>) -> bool;
}
Expand description

Type of pattern that matches against an individual (non-leaf) AST node.

Required Associated Constants§

source

const INCLUDES_TRIVIA: bool

Does this AST include trivia? Trivia is useful for being able to re-print an AST, but not all parsers support collecting it.

Required Methods§

source

fn children<'a>( &'a self, definitions: &'a StaticDefinitions<'_, Q>, ) -> Vec<PatternOrPredicate<'a, Q>>

source

fn matches_kind_of(&self, node: &Q::Node<'_>) -> bool

Object Safety§

This trait is not object safe.

Implementors§