Versions in this module Expand all Collapse all v0 v0.2.0 Oct 2, 2026 v0.1.0 Oct 1, 2026 Changes in this version + type Encoding int + const EncodingUTF16BE + const EncodingUTF16LE + const EncodingUTF8 + func (e Encoding) String() string + type Error string + const ErrIncompatibleLanguage + const ErrInvalidInput + const ErrInvalidRanges + const ErrLanguageMismatch + const ErrNoLanguage + func (e Error) Error() string + type FieldID uint16 + type FieldInfo struct + Multiple bool + Required bool + Types []NodeKind + type Input interface + ReadAt func(offset int, at Point) []byte + type InputEdit struct + NewEndByte int + NewEndPoint Point + OldEndByte int + OldEndPoint Point + StartByte int + StartPoint Point + type Language struct + func NewLanguage(tables *abi.Language) *Language + func (l *Language) ABIVersion() int + func (l *Language) FieldCount() int + func (l *Language) FieldForName(name string) (FieldID, bool) + func (l *Language) FieldName(id FieldID) string + func (l *Language) LookaheadIterator(state StateID) (*LookaheadIterator, bool) + func (l *Language) Metadata() (LanguageMetadata, bool) + func (l *Language) Name() string + func (l *Language) NextState(state StateID, symbol Symbol) StateID + func (l *Language) StateCount() int + func (l *Language) Subtypes(supertype Symbol) []Symbol + func (l *Language) Supertypes() []Symbol + func (l *Language) SymbolCount() int + func (l *Language) SymbolForName(name string, named bool) (Symbol, bool) + func (l *Language) SymbolName(symbol Symbol) string + func (l *Language) SymbolType(symbol Symbol) SymbolType + type LanguageMetadata struct + Major int + Minor int + Patch int + type LogType int + const LogLex + const LogParse + func (t LogType) String() string + type LookaheadIterator struct + func (it *LookaheadIterator) Language() *Language + func (it *LookaheadIterator) Names() iter.Seq[string] + func (it *LookaheadIterator) Reset(language *Language, state StateID) bool + func (it *LookaheadIterator) ResetState(state StateID) bool + func (it *LookaheadIterator) Symbols() iter.Seq[Symbol] + type Node struct + func (n *Node) Edit(e InputEdit) + func (n Node) Child(i int) (Node, bool) + func (n Node) ChildByFieldID(fieldID FieldID) (Node, bool) + func (n Node) ChildByFieldName(name string) (Node, bool) + func (n Node) ChildCount() int + func (n Node) ChildWithDescendant(descendant Node) (Node, bool) + func (n Node) Children() iter.Seq[Node] + func (n Node) ChildrenByFieldName(name string) iter.Seq[Node] + func (n Node) DescendantCount() int + func (n Node) DescendantForByteRange(start, end int) (Node, bool) + func (n Node) DescendantForPointRange(start, end Point) (Node, bool) + func (n Node) EndByte() int + func (n Node) EndPoint() Point + func (n Node) Equal(other Node) bool + func (n Node) FieldNameForChild(i int) string + func (n Node) FieldNameForNamedChild(i int) string + func (n Node) FirstChildForByte(offset int) (Node, bool) + func (n Node) FirstNamedChildForByte(offset int) (Node, bool) + func (n Node) GrammarID() Symbol + func (n Node) GrammarKind() string + func (n Node) HasChanges() bool + func (n Node) HasError() bool + func (n Node) IsError() bool + func (n Node) IsExtra() bool + func (n Node) IsMissing() bool + func (n Node) IsNamed() bool + func (n Node) Kind() string + func (n Node) KindID() Symbol + func (n Node) Language() *Language + func (n Node) NamedChild(i int) (Node, bool) + func (n Node) NamedChildCount() int + func (n Node) NamedChildren() iter.Seq[Node] + func (n Node) NamedDescendantForByteRange(start, end int) (Node, bool) + func (n Node) NamedDescendantForPointRange(start, end Point) (Node, bool) + func (n Node) NextNamedSibling() (Node, bool) + func (n Node) NextParseState() StateID + func (n Node) NextSibling() (Node, bool) + func (n Node) Parent() (Node, bool) + func (n Node) ParseState() StateID + func (n Node) PrevNamedSibling() (Node, bool) + func (n Node) PrevSibling() (Node, bool) + func (n Node) Range() Range + func (n Node) StartByte() int + func (n Node) StartPoint() Point + func (n Node) String() string + func (n Node) Text(src []byte) string + func (n Node) Walk() *TreeCursor + type NodeKind struct + Kind string + Named bool + type NodeType struct + Children *FieldInfo + Extra bool + Fields map[string]FieldInfo + Kind string + Named bool + Root bool + Subtypes []NodeKind + type Parser struct + func NewParser() *Parser + func (p *Parser) IncludedRanges() []Range + func (p *Parser) Language() *Language + func (p *Parser) Parse(ctx context.Context, src []byte, old *Tree) (*Tree, error) + func (p *Parser) ParseInput(ctx context.Context, in Input, enc Encoding, old *Tree) (*Tree, error) + func (p *Parser) PrintDotGraphs(w io.Writer) + func (p *Parser) Reset() + func (p *Parser) SetIncludedRanges(ranges []Range) error + func (p *Parser) SetLanguage(language *Language) error + func (p *Parser) SetLogger(fn func(LogType, string)) + func (p *Parser) StatesAt(ctx context.Context, src []byte, offset int, old *Tree) ([]StateID, error) + type Point struct + Column int + Row int + type Quantifier int + const QuantifierOne + const QuantifierOneOrMore + const QuantifierZero + const QuantifierZeroOrMore + const QuantifierZeroOrOne + func (q Quantifier) String() string + type Query struct + func NewQuery(language *Language, source string) (*Query, error) + func (q *Query) CaptureIndexForName(name string) (int, bool) + func (q *Query) CaptureNames() []string + func (q *Query) CaptureQuantifiers(index int) []Quantifier + func (q *Query) DisableCapture(name string) + func (q *Query) DisablePattern(index int) + func (q *Query) EndByteForPattern(patternIndex int) int + func (q *Query) GeneralPredicates(index int) []QueryPredicate + func (q *Query) IsPatternGuaranteedAtStep(byteOffset int) bool + func (q *Query) IsPatternNonLocal(index int) bool + func (q *Query) IsPatternRooted(index int) bool + func (q *Query) PatternCount() int + func (q *Query) PropertyPredicates(index int) []QueryPropertyPredicate + func (q *Query) PropertySettings(index int) []QueryProperty + func (q *Query) StartByteForPattern(patternIndex int) int + type QueryCapture struct + Index int + Node Node + type QueryCursor struct + func NewQueryCursor() *QueryCursor + func (c *QueryCursor) Captures(ctx context.Context, q *Query, n Node, src []byte) iter.Seq2[QueryMatch, int] + func (c *QueryCursor) DidExceedMatchLimit() bool + func (c *QueryCursor) MatchLimit() int + func (c *QueryCursor) Matches(ctx context.Context, q *Query, n Node, src []byte) iter.Seq[QueryMatch] + func (c *QueryCursor) SetByteRange(start, end int) + func (c *QueryCursor) SetContainingByteRange(start, end int) + func (c *QueryCursor) SetContainingPointRange(start, end Point) + func (c *QueryCursor) SetMatchLimit(limit int) + func (c *QueryCursor) SetMaxStartDepth(depth int) + func (c *QueryCursor) SetPointRange(start, end Point) + type QueryError struct + Column int + Kind QueryErrorKind + Message string + Offset int + Row int + func (e *QueryError) Error() string + type QueryErrorKind int + const QueryErrorCapture + const QueryErrorField + const QueryErrorLanguage + const QueryErrorNodeType + const QueryErrorNone + const QueryErrorPredicate + const QueryErrorStructure + const QueryErrorSyntax + func (k QueryErrorKind) String() string + type QueryMatch struct + Captures []QueryCapture + PatternIndex int + func (m QueryMatch) Remove() + type QueryPredicate struct + Args []QueryPredicateArg + Operator string + type QueryPredicateArg struct + Capture int + IsCapture bool + Value string + type QueryProperty struct + CaptureID int + HasValue bool + Key string + Value string + type QueryPropertyPredicate struct + Positive bool + Property QueryProperty + type Range struct + EndByte int + EndPoint Point + StartByte int + StartPoint Point + type StateID uint16 + type Symbol uint16 + type SymbolType int + const SymbolAnonymous + const SymbolAuxiliary + const SymbolRegular + const SymbolSupertype + func (t SymbolType) String() string + type Tree struct + func (t *Tree) ChangedRanges(newTree *Tree) []Range + func (t *Tree) Close() + func (t *Tree) Copy() *Tree + func (t *Tree) Edit(e InputEdit) + func (t *Tree) IncludedRanges() []Range + func (t *Tree) Language() *Language + func (t *Tree) PrintDotGraph(w io.Writer) + func (t *Tree) RootNode() Node + func (t *Tree) RootNodeWithOffset(offset int, at Point) Node + func (t *Tree) Walk() *TreeCursor + type TreeCursor struct + func (c *TreeCursor) Copy() *TreeCursor + func (c *TreeCursor) Depth() int + func (c *TreeCursor) DescendantIndex() int + func (c *TreeCursor) FieldID() FieldID + func (c *TreeCursor) FieldName() string + func (c *TreeCursor) GotoDescendant(index int) + func (c *TreeCursor) GotoFirstChild() bool + func (c *TreeCursor) GotoFirstChildForByte(offset int) (int, bool) + func (c *TreeCursor) GotoFirstChildForPoint(at Point) (int, bool) + func (c *TreeCursor) GotoLastChild() bool + func (c *TreeCursor) GotoNextSibling() bool + func (c *TreeCursor) GotoParent() bool + func (c *TreeCursor) GotoPreviousSibling() bool + func (c *TreeCursor) Node() Node + func (c *TreeCursor) Reset(n Node) + func (c *TreeCursor) ResetTo(other *TreeCursor)