Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeHandler ¶
NodeHandler defines a function that handles a specific AST node.
type ParsedFile ¶
type ParsedFile struct {
File *ast.File // Parsed AST
Fset *token.FileSet // FileSet for position mapping
Path string // Absolute file path
Source []byte // Raw source code (optional)
}
ParsedFile represents a parsed Go source file with its AST and FileSet.
func ParseFile ¶
func ParseFile(path string) (*ParsedFile, error)
ParseFile parses a Go source file into an AST with a new FileSet.
func ParseSource ¶
func ParseSource(path string, src []byte) (*ParsedFile, error)
ParseSource parses the provided Go source code (in-memory) with a new FileSet.
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker allows walking through the AST with custom handlers per node type.
func (*Walker) RegisterHandler ¶
func (w *Walker) RegisterHandler(nodeType string, handler NodeHandler)
RegisterHandler registers a handler for the given node type (e.g. *ast.CallExpr).
Click to show internal directories.
Click to hide internal directories.