pub trait Matcher<L: Language> {
    fn match_node_with_env<'tree>(
        &self,
        _node: Node<'tree, L>,
        _env: &mut MetaVarEnv<'tree, L>
    ) -> Option<Node<'tree, L>>; fn potential_kinds(&self) -> Option<BitSet> { ... } fn get_match_len(&self, _node: Node<'_, L>) -> Option<usize> { ... } fn match_node<'tree>(
        &self,
        node: Node<'tree, L>
    ) -> Option<NodeMatch<'tree, L>> { ... } fn get_meta_var_matchers(&self) -> MetaVarMatchers<L> { ... } fn get_meta_var_env<'tree>(&self) -> MetaVarEnv<'tree, L> { ... } fn find_node<'tree>(
        &self,
        node: Node<'tree, L>
    ) -> Option<NodeMatch<'tree, L>> { ... } }
Expand description

N.B. At least one positive term is required for matching

Required Methods§

Returns the node why the input is matched or None if not matched. The return value is usually input node itself, but it can be different node. For example Has matcher can return the child or descendant node.

Provided Methods§

Returns a bitset for all possible target node kind ids. Returns None if the matcher needs to try against all node kind.

get_match_len will skip trailing anonymous child node to exclude punctuation.

Trait Implementations§

Returns the node why the input is matched or None if not matched. The return value is usually input node itself, but it can be different node. For example Has matcher can return the child or descendant node.
Returns a bitset for all possible target node kind ids. Returns None if the matcher needs to try against all node kind.
get_match_len will skip trailing anonymous child node to exclude punctuation.

Implementations on Foreign Types§

Implementors§