filter

package
v0.0.0-...-3ce278f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeCollector

type NodeCollector interface {
	Collect(file *ast.File, fset *token.FileSet, fileAbs string)
}

NodeCollector defines the interface for types that can collect and process AST nodes from a source file.

type NodeFilter

type NodeFilter interface {
	ShouldSkip(node ast.Node, mutatorName string) bool
}

NodeFilter defines the interface for types that can determine if an AST node should be excluded from mutation.

type SkipMakeArgsFilter

type SkipMakeArgsFilter struct {
	// IgnoredNodes maps positions of numeric literals to their parent 'make' call expressions
	IgnoredNodes map[token.Pos]*ast.CallExpr
}

SkipMakeArgsFilter is a filter that tracks numeric arguments in 'make' calls for slices and maps to be ignored during mutation.

func NewSkipMakeArgsFilter

func NewSkipMakeArgsFilter() *SkipMakeArgsFilter

NewSkipMakeArgsFilter creates and returns a new initialized Processor.

func (*SkipMakeArgsFilter) Collect

func (s *SkipMakeArgsFilter) Collect(file *ast.File, _ *token.FileSet, _ string)

Collect collects numeric arguments (children) from 'make' calls (parents) for slices/maps to be ignored during mutation

func (*SkipMakeArgsFilter) ShouldSkip

func (s *SkipMakeArgsFilter) ShouldSkip(node ast.Node, _ string) bool

ShouldSkip determines whether a given AST node should be skipped during mutation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL