tsitter

package
v0.0.0-...-f3d8e19 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BodyHash

func BodyHash(node *sitter.Node, src []byte) string

BodyHash returns the SHA-256 hash (first 8 hex chars) of a function node's full source text (signature + body). Both the parse and llmc paths call this single function with the same node text, so their hashes always agree.

func CSharpLanguage

func CSharpLanguage() *sitter.Language

CSharpLanguage returns the C# tree-sitter grammar handle.

func JavaLanguage

func JavaLanguage() *sitter.Language

JavaLanguage returns the Java tree-sitter grammar handle.

func MaxDepth

func MaxDepth(node *sitter.Node, current int) int

MaxDepth returns the maximum "block" nesting depth under node. A child named "block" increments the running depth; all other named children are walked at the same depth. The deepest path wins.

func NodeLines

func NodeLines(node *sitter.Node) int

NodeLines returns the number of source lines a node spans, inclusive of both its start and end rows.

func ParseSource

func ParseSource(src []byte, lang *sitter.Language) (*sitter.Tree, error)

ParseSource parses source bytes with the given tree-sitter grammar and returns the resulting syntax tree.

func RunQuery

func RunQuery(pattern string, root *sitter.Node, lang *sitter.Language) ([]*sitter.Node, error)

RunQuery executes an S-expression query against root using the given grammar and returns every captured node, in match order.

func RustLanguage

func RustLanguage() *sitter.Language

RustLanguage returns the Rust tree-sitter grammar handle.

Types

This section is empty.

Jump to

Keyboard shortcuts

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