Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLanguage ¶
func GetLanguage(l lang.Language) (*tree_sitter.Language, error)
GetLanguage returns the tree-sitter Language for a lang.Language.
func NodeText ¶
func NodeText(node *tree_sitter.Node, source []byte) string
NodeText returns the text content of a node.
func Parse ¶
Parse parses source code into a tree-sitter AST Tree. The caller must call tree.Close() when done. Parsers are pooled per language via sync.Pool to avoid per-file allocation.
func Walk ¶
func Walk(node *tree_sitter.Node, fn WalkFunc)
Walk traverses the AST in depth-first order.
Types ¶
type WalkFunc ¶
type WalkFunc func(node *tree_sitter.Node) bool
WalkFunc is called for each node during AST traversal. Return false to skip children.
Click to show internal directories.
Click to hide internal directories.