Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsGenerated ¶
IsGenerated checks if a file contains the "Code generated" comment.
Types ¶
type MutationTarget ¶
type MutationTarget struct {
File string
Line int
Column int
EndLine int
EndCol int
NodeType string // e.g., "BinaryExpr", "UnaryExpr", "IfStmt"
Original string // original source text
Node ast.Node // the AST node (for mutation application)
StartPos token.Pos // start position in file
EndPos token.Pos // end position in file
}
MutationTarget represents a location in source code that can be mutated.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles parsing Go source files and identifying mutation targets.
func (*Parser) ParseFile ¶
func (p *Parser) ParseFile(path string) (*SourceFile, error)
ParseFile parses a single Go file and identifies mutation targets.
func (*Parser) ParsePackages ¶
func (p *Parser) ParsePackages(pattern string) ([]*SourceFile, error)
ParsePackages parses all Go files in the given package pattern.
type SourceFile ¶
type SourceFile struct {
Path string
Package string
Fset *token.FileSet
AST *ast.File
Content []byte // original file content for mutation
Targets []MutationTarget
}
SourceFile represents a parsed Go source file with mutation targets.
Click to show internal directories.
Click to hide internal directories.