treesitter

package
v0.0.0-...-2843bd2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser wraps go-tree-sitter with multi-language support and caching.

func New

func New(language string) (*Parser, error)

New creates a new Parser initialized for the given language.

func (*Parser) Language

func (p *Parser) Language() string

Language returns the current language name.

func (*Parser) Parse

func (p *Parser) Parse(code []byte, language string) (*sitter.Tree, error)

Parse parses source code and returns a tree-sitter Tree. If language is non-empty and different from the current one, it switches first.

func (*Parser) SetLanguage

func (p *Parser) SetLanguage(language string) error

SetLanguage switches the parser to a different language.

Jump to

Keyboard shortcuts

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