Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter converts tree-sitter AST to our IR format
func NewConverter ¶
NewConverter creates a new AST to IR converter
func (*Converter) ConvertTree ¶
ConvertTree converts a tree-sitter tree to our IR format
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a node in the syntax tree
func (*Node) ChildCount ¶
ChildCount returns the number of children
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a tree-sitter parser instance
func NewParser ¶
func NewParser(module *WASMModule) (*Parser, error)
NewParser creates a new parser for the given WASM module
func (*Parser) SetLanguage ¶
SetLanguage sets the language for the parser
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree represents a parsed syntax tree
type WASMModule ¶
type WASMModule struct {
Name string
Language string
Module api.Module
Compiled wazero.CompiledModule
// Function references
TreeSitterLanguage api.Function
ParserNew api.Function
ParserDelete api.Function
ParserParse api.Function
ParserSetLanguage api.Function
TreeDelete api.Function
TreeRootNode api.Function
NodeString api.Function
NodeChildCount api.Function
NodeChild api.Function
NodeType api.Function
NodeStartByte api.Function
NodeEndByte api.Function
NodeStartPoint api.Function
NodeEndPoint api.Function
NodeIsNamed api.Function
NodeIsError api.Function
NodeFieldNameForChild api.Function
NodeChildByFieldName api.Function
}
WASMModule represents a loaded tree-sitter WASM module
type WASMRuntime ¶
type WASMRuntime struct {
// contains filtered or unexported fields
}
WASMRuntime manages WASM modules for tree-sitter parsers
func NewWASMRuntime ¶
func NewWASMRuntime(ctx context.Context) (*WASMRuntime, error)
NewWASMRuntime creates a new WASM runtime for tree-sitter parsers
func (*WASMRuntime) GetModule ¶
func (w *WASMRuntime) GetModule(name string) (*WASMModule, error)
GetModule returns a loaded WASM module
func (*WASMRuntime) LoadModule ¶
func (w *WASMRuntime) LoadModule(name string, wasmBytes []byte) error
LoadModule loads a tree-sitter WASM module