Versions in this module Expand all Collapse all v0 v0.5.0 Oct 2, 2022 Changes in this version + func Compile(config CompileConfig) (*Pattern, PatternInfo, error) + func IsEmptyNodeSlice(n ast.Node) bool + func Walk(root ast.Node, fn func(n ast.Node) bool) + type CapturedNode struct + Name string + Node ast.Node + type CompileConfig struct + Fset *token.FileSet + Imports map[string]string + Src string + Strict bool + WithTypes bool + type MatchData struct + Capture []CapturedNode + Node ast.Node + func (data MatchData) CapturedByName(name string) (ast.Node, bool) + type MatcherState struct + CapturePreset []CapturedNode + Types *types.Info + func NewMatcherState() MatcherState + type NodeSlice struct + Kind NodeSliceKind + func (s *NodeSlice) At(i int) ast.Node + func (s *NodeSlice) End() token.Pos + func (s *NodeSlice) GetDeclSlice() []ast.Decl + func (s *NodeSlice) GetExprSlice() []ast.Expr + func (s *NodeSlice) GetFieldSlice() []*ast.Field + func (s *NodeSlice) GetIdentSlice() []*ast.Ident + func (s *NodeSlice) GetSpecSlice() []ast.Spec + func (s *NodeSlice) GetStmtSlice() []ast.Stmt + func (s *NodeSlice) Len() int + func (s *NodeSlice) Pos() token.Pos + func (s *NodeSlice) SliceInto(dst *NodeSlice, i, j int) + type NodeSliceKind uint32 + const DeclNodeSlice + const ExprNodeSlice + const FieldNodeSlice + const IdentNodeSlice + const SpecNodeSlice + const StmtNodeSlice + type PartialNode struct + X ast.Node + func (p *PartialNode) End() token.Pos + func (p *PartialNode) Pos() token.Pos + type Pattern struct + func (p *Pattern) Clone() *Pattern + func (p *Pattern) MatchNode(state *MatcherState, n ast.Node, cb func(MatchData)) + func (p *Pattern) NodeTag() nodetag.Value + type PatternInfo struct + Vars map[string]struct{}