Module ast_grep_core::matcher

source ·
Expand description

This module defines the core Matcher trait in ast-grep.

Matcher has three notable implementations in this module:

  • Pattern: matches against a tree-sitter node based on its tree structure.
  • KindMatcher: matches a node based on its kind
  • RegexMatcher: matches a node based on its textual content using regex.

Structs§

Enums§

Traits§

  • Matcher defines whether a tree-sitter node matches certain pattern, and update the matched meta-variable values in MetaVarEnv. N.B. At least one positive term is required for matching