Help us shape the future of Go! Take the 2026 Go Developer Survey

treesitter

package module
v0.0.0-...-3e473ae Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 8 Imported by: 0

README

go-tree-sitter

A tree-sitter runtime written in pure Go. No cgo, no WebAssembly runtime, and no external binary at run time.

Every other Go binding to tree-sitter is a cgo wrapper around the upstream C library. That rules them all out for a consumer such as slopfix. It ships as a fat APE, cross-compiled for linux and darwin on amd64 and arm64 with CGO_ENABLED=0. This runtime builds under that setting. It therefore cross-compiles to any target Go supports.

The three parts, because this is the thing readers get wrong

A grammar.js file is data. It describes a language and it parses nothing.

tree-sitter generate reads that data and emits a parse table, as C source. The table is the language.

A runtime walks that table against real bytes and builds a tree. This repository is the runtime. grammars/ holds tables cmd/ts-translate reads out of that C.

Install

go get github.com/wow-look-at-my/go-tree-sitter

Parse a file

package main

import (
	"fmt"

	ts "github.com/wow-look-at-my/go-tree-sitter"
	"github.com/wow-look-at-my/go-tree-sitter/grammars/golang"
)

func main() {
	parser := ts.NewParser()
	parser.SetLanguage(golang.Language())

	tree := parser.ParseString(nil, []byte("package main\n"))
	root := tree.RootNode()

	fmt.Println(root.Type())       // source_file
	fmt.Println(root.StartPoint()) // {0 0}
	fmt.Println(root.String())     // (source_file (package_clause (package_identifier)))
}

Node also carries NamedChild, Parent, NextSibling, ChildByFieldName, and byte and point ranges. Tree.Walk returns a cursor for a full traversal.

Status

Each grammar runs the upstream grammar repository's own test/corpus suite, and every case in it passes. The real tree-sitter test command reports the same case counts on the same commits. That is what proves the reader is not dropping cases.

The corpus reader is a port of the tree-sitter CLI's own reader. A case is therefore read and compared the way upstream reads and compares it.

Grammars

Go, C, C++, Rust, Bash, JavaScript, TypeScript and TSX.

A grammar that ships a hand-written scanner.c needs that scanner ported by hand. No machine translation reads C well enough to do it. grammars/*/scanner.go is that port. The upstream corpus says whether it is right. TSX shares TypeScript's scanner, the way upstream compiles both from one header.

ts-translate writes tables.zst per grammar, and the parser.go that embeds it. Neither is committed. Both are derived. The repository keeps the input, and the generate step produces the rest at build time, into the binary. grammar.go beside them is hand written and compiles without them, which is what lets a consumer import a grammar for its Scanner(). Language() panics until the generate step ran.

The blob holds the lexer too. A tree-sitter lexer arrives as a C function of a few thousand gotos. Translating that into Go source put about a megabyte of it in each grammar. It is a state machine, so it travels as data instead. The generated Go is down to the loader that embeds the blob. lexprog.go defines multiple instructions and runs them.

A whole parse costs about 12% more than the compiled form did, which BenchmarkParse measures.

The limit worth knowing

A grammar reaches this runtime by way of cmd/ts-translate, which refuses an ABI outside the range parser_core.go accepts. A grammar outside that range fails the build rather than becoming a package that loads and parses nothing.

Tests

The corpora are git submodules. A clone needs them:

git clone --recurse-submodules https://github.com/wow-look-at-my/go-tree-sitter.git
cd go-tree-sitter
go-toolchain

A checkout without the submodules fails the corpus tests loudly rather than reporting a green over zero cases.

Documentation

Index

Constants

View Source
const (
	ParseActionTypeShift uint8 = iota
	ParseActionTypeReduce
	ParseActionTypeAccept
	ParseActionTypeRecover
)

Parse action types.

View Source
const (
	MinABIVersion = 13
	MaxABIVersion = 15
)

A generator must refuse an ABI outside this range: the tables would parse nothing. See checkABI in cmd/ts-translate.

View Source
const (
	BinOr int32 = iota
	BinAnd
	BinBitOr
	BinXor
	BinBitAnd
	BinEq
	BinNe
	BinLt
	BinGt
	BinLe
	BinGe
	BinShl
	BinShr
	BinAdd
	BinSub
	BinMul
	BinDiv
	BinMod
)

The binary operators a lex condition uses, as OpBinary's Arg.

Variables

This section is empty.

Functions

func DecodeUTF8

func DecodeUTF8(s []byte) (int32, uint32)

DecodeUTF8 mirrors the reference implementation's byte sequence handling, including how far it advances over an ill formed sequence.

func DecodeUTF16BE

func DecodeUTF16BE(s []byte) (int32, uint32)

DecodeUTF16BE decodes a single code point from big endian input.

func DecodeUTF16LE

func DecodeUTF16LE(s []byte) (int32, uint32)

DecodeUTF16LE decodes a single code point from little endian input.

func EncodeTables

func EncodeTables(t *Tables) ([]byte, error)

EncodeTables writes a grammar's data as a compressed blob.

func SetContains

func SetContains(ranges []CharacterRange, lookahead int32) bool

SetContains reports whether a code point falls in any of the sorted ranges.

Types

type CharacterRange

type CharacterRange struct {
	Start int32
	End   int32
}

CharacterRange is an inclusive range of code points.

type ExternalScanner

type ExternalScanner interface {
	Create() any
	Destroy(payload any)
	Scan(payload any, lexer *Lexer, validSymbols []bool) bool
	Serialize(payload any, buffer []byte) uint32
	Deserialize(payload any, buffer []byte)
}

ExternalScanner is the set of callbacks a hand written scanner provides.

type FieldID

type FieldID = uint16

FieldID identifies a field name in a grammar.

type FieldMapEntry

type FieldMapEntry struct {
	FieldID    FieldID
	ChildIndex uint8
	Inherited  bool
}

FieldMapEntry associates a field name with a child position.

type Input

type Input struct {
	Read     func(byteOffset uint32, position Point) []byte
	Encoding InputEncoding
	Decode   func([]byte) (int32, uint32)
}

Input supplies source text to the parser in chunks.

type InputEdit

type InputEdit struct {
	StartByte   uint32
	OldEndByte  uint32
	NewEndByte  uint32
	StartPoint  Point
	OldEndPoint Point
	NewEndPoint Point
}

InputEdit describes a change to a document.

type InputEncoding

type InputEncoding int

InputEncoding selects how the source bytes are decoded.

const (
	EncodingUTF8 InputEncoding = iota
	EncodingUTF16LE
	EncodingUTF16BE
	EncodingCustom
)

Supported source encodings.

type Language

type Language struct {
	ABIVersion            uint32
	SymbolCount           uint32
	AliasCount            uint32
	TokenCount            uint32
	ExternalTokenCount    uint32
	StateCount            uint32
	LargeStateCount       uint32
	ProductionIDCount     uint32
	FieldCount            uint32
	MaxAliasSequenceLen   uint16
	ParseTable            []uint16
	SmallParseTable       []uint16
	SmallParseTableMap    []uint32
	ParseActions          []ParseActionEntry
	SymbolNames           []string
	FieldNames            []string
	FieldMapSlices        []MapSlice
	FieldMapEntries       []FieldMapEntry
	SymbolMetadataTable   []SymbolMetadata
	PublicSymbolMap       []Symbol
	AliasMap              []uint16
	AliasSequences        []Symbol
	LexModes              []LexerMode
	LexFn                 func(*Lexer, StateID) bool
	KeywordLexFn          func(*Lexer, StateID) bool
	KeywordCaptureToken   Symbol
	ExternalScannerStates []bool
	ExternalScannerSymbol []Symbol
	Scanner               ExternalScanner
	PrimaryStateIDs       []StateID
	Name                  string
	ReservedWords         []Symbol
	MaxReservedWordSetLen uint16
	SupertypeCount        uint32
	SupertypeSymbols      []Symbol
	SupertypeMapSlices    []MapSlice
	SupertypeMapEntries   []Symbol
	Metadata              LanguageMetadata
}

Language holds a grammar's parse tables and lexer functions.

func LoadGrammar

func LoadGrammar(name string, blob []byte, scanner ExternalScanner) *Language

LoadGrammar decodes a grammar's table blob and wires its lexer. Pass a nil scanner for a grammar with no external tokens.

It panics on a blob this runtime cannot read. A grammar that parses nothing is worse to hand back than a stop at the point the fault is visible.

func (*Language) AliasAt

func (l *Language) AliasAt(productionID uint32, childIndex uint32) Symbol

AliasAt reports the alias applied to a single child of a production.

func (*Language) AliasesForSymbol

func (l *Language) AliasesForSymbol(originalSymbol Symbol) []Symbol

AliasesForSymbol reports every public name a symbol can take.

func (*Language) FieldIDForName

func (l *Language) FieldIDForName(name string) FieldID

FieldIDForName returns the identifier of a named field.

func (*Language) FieldNameForID

func (l *Language) FieldNameForID(id FieldID) string

FieldNameForID returns a field's name.

func (*Language) LanguageName

func (l *Language) LanguageName() string

LanguageName reports the grammar's own name.

func (*Language) StateIsPrimary

func (l *Language) StateIsPrimary(state StateID) bool

StateIsPrimary reports whether a state is the canonical any of its class.

func (*Language) Subtypes

func (l *Language) Subtypes(supertype Symbol) []Symbol

Subtypes reports the symbols that a supertype covers.

func (*Language) Supertypes

func (l *Language) Supertypes() []Symbol

Supertypes reports the grammar's supertype symbols.

func (*Language) SymbolCountTotal

func (l *Language) SymbolCountTotal() uint32

SymbolCountTotal reports the number of symbols including aliases.

func (*Language) SymbolForName

func (l *Language) SymbolForName(name string, isNamed bool) Symbol

SymbolForName finds a symbol by its display name.

func (*Language) SymbolName

func (l *Language) SymbolName(symbol Symbol) string

SymbolName returns the display name for a symbol.

type LanguageMetadata

type LanguageMetadata struct {
	MajorVersion uint8
	MinorVersion uint8
	PatchVersion uint8
}

LanguageMetadata is a grammar's semantic version.

type LexInstr

type LexInstr struct {
	Op  LexOp
	Arg int32
}

LexInstr is a single instruction and its single argument.

type LexOp

type LexOp uint8

LexOp is a single instruction of a lexer program.

const (
	// OpPushLit pushes Arg.
	OpPushLit LexOp = iota
	// OpPushLookahead pushes the code point at the current position.
	OpPushLookahead
	// OpPushEOF pushes the end-of-input flag this iteration read.
	OpPushEOF
	// OpPushSet pushes whether character set Arg holds the lookahead.
	OpPushSet
	// OpNot and OpNeg replace the top of the stack.
	OpNot
	OpNeg
	// OpBinary combines the top values with binary operator Arg.
	OpBinary
	// OpJumpIfFalse pops, and jumps to Arg when the value is empty.
	OpJumpIfFalse
	// OpDispatch jumps to the body of the case for the current state.
	OpDispatch
	// OpAdvance and OpSkip move to state Arg. Skip drops what it consumed.
	OpAdvance
	OpSkip
	// OpAdvanceMap reads map Arg, and advances on a lookahead the map names.
	OpAdvanceMap
	// OpAccept marks the token Arg, ending here.
	OpAccept
	// OpEnd answers with what the run accepted. OpReturn answers Arg.
	OpEnd
	OpReturn
	// OpReadEOF reads the end-of-input flag.
	OpReadEOF
)

type LexProgram

type LexProgram struct {
	Code   []LexInstr
	States []int32
	Maps   [][]int32
}

LexProgram is a lexer state machine. Code opens with the prologue and an OpDispatch, and the case bodies follow it.

func (*LexProgram) Run

func (p *LexProgram) Run(sets [][]CharacterRange, lexer *Lexer, state StateID) bool

Run walks the program for a single token.

type Lexer

type Lexer struct {
	// Lookahead is the code point at the current position.
	Lookahead int32
	// ResultSymbol is set by a lex function when it accepts a token.
	ResultSymbol Symbol
	// contains filtered or unexported fields
}

Lexer scans the source text on behalf of a grammar's lex functions.

func (*Lexer) Advance

func (l *Lexer) Advance(skip bool)

Advance consumes the current code point.

func (*Lexer) EOF

func (l *Lexer) EOF() bool

EOF reports whether the lexer consumed all included ranges.

func (*Lexer) GetColumn

func (l *Lexer) GetColumn() uint32

GetColumn reports the column of the current position.

func (*Lexer) IsAtIncludedRangeStart

func (l *Lexer) IsAtIncludedRangeStart() bool

IsAtIncludedRangeStart reports whether the lexer sits on a range boundary.

func (*Lexer) MarkEnd

func (l *Lexer) MarkEnd()

MarkEnd records the end of the token being scanned.

type LexerMode

type LexerMode struct {
	LexState          uint16
	ExternalLexState  uint16
	ReservedWordSetID uint16
}

LexerMode selects the lex state used when scanning in a parse state.

type MapSlice

type MapSlice struct {
	Index  uint16
	Length uint16
}

MapSlice indexes into the field and supertype maps.

type Node

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

Node is a single node in a syntax tree.

func (Node) Child

func (n Node) Child(index uint32) Node

Child returns the visible child at the given index.

func (Node) ChildByFieldID

func (n Node) ChildByFieldID(fieldID FieldID) Node

ChildByFieldID returns the child registered under the given field.

func (Node) ChildByFieldName

func (n Node) ChildByFieldName(name string) Node

ChildByFieldName returns the child registered under the given field name.

func (Node) ChildCount

func (n Node) ChildCount() uint32

ChildCount reports the number of visible children.

func (Node) ChildWithDescendant

func (n Node) ChildWithDescendant(descendant Node) Node

ChildWithDescendant returns the child that contains the given descendant.

func (Node) Children

func (n Node) Children() []Node

Children returns every visible child, as Child returns each. It reads the children once.

func (Node) DescendantCount

func (n Node) DescendantCount() uint32

DescendantCount reports how many visible nodes the subtree holds.

func (Node) DescendantForByteRange

func (n Node) DescendantForByteRange(start, end uint32) Node

DescendantForByteRange returns the smallest node spanning the byte range.

func (Node) DescendantForPointRange

func (n Node) DescendantForPointRange(start, end Point) Node

DescendantForPointRange returns the smallest node spanning the point range.

func (*Node) Edit

func (n *Node) Edit(edit InputEdit)

Edit shifts the node's recorded position to account for a change.

func (Node) EndByte

func (n Node) EndByte() uint32

EndByte reports the offset past the node.

func (Node) EndPoint

func (n Node) EndPoint() Point

EndPoint reports the row and column past the node.

func (Node) Equal

func (n Node) Equal(other Node) bool

Equal reports whether nodes refer to the same place in the same tree.

func (Node) FieldNameForChild

func (n Node) FieldNameForChild(index uint32) string

FieldNameForChild reports the field name of the visible child at an index.

func (Node) FieldNameForNamedChild

func (n Node) FieldNameForNamedChild(index uint32) string

FieldNameForNamedChild reports the field name of the named child at an index.

func (Node) GrammarSymbol

func (n Node) GrammarSymbol() Symbol

GrammarSymbol reports the node's symbol before alias resolution.

func (Node) GrammarType

func (n Node) GrammarType() string

GrammarType reports the node's rule name before alias resolution.

func (Node) HasChanges

func (n Node) HasChanges() bool

HasChanges reports whether an edit touched the node.

func (Node) HasError

func (n Node) HasError() bool

HasError reports whether the node or a descendant is an error.

func (Node) IsError

func (n Node) IsError() bool

IsError reports whether the node itself is an error node.

func (Node) IsExtra

func (n Node) IsExtra() bool

IsExtra reports whether the node sits outside the grammar's main rules.

func (Node) IsMissing

func (n Node) IsMissing() bool

IsMissing reports whether the parser inserted the node during recovery.

func (Node) IsNamed

func (n Node) IsNamed() bool

IsNamed reports whether the node has a name in the grammar.

func (Node) IsNull

func (n Node) IsNull() bool

IsNull reports whether the node refers to nothing.

func (Node) NamedChild

func (n Node) NamedChild(index uint32) Node

NamedChild returns the named child at the given index.

func (Node) NamedChildCount

func (n Node) NamedChildCount() uint32

NamedChildCount reports the number of named children.

func (Node) NamedChildren

func (n Node) NamedChildren() []Node

NamedChildren returns every named child, as NamedChild returns each.

func (Node) NamedDescendantForByteRange

func (n Node) NamedDescendantForByteRange(start, end uint32) Node

NamedDescendantForByteRange returns the smallest named node spanning the range.

func (Node) NamedDescendantForPointRange

func (n Node) NamedDescendantForPointRange(start, end Point) Node

NamedDescendantForPointRange returns the smallest named node spanning the range.

func (Node) NextNamedSibling

func (n Node) NextNamedSibling() Node

NextNamedSibling returns the next named node with the same parent.

func (Node) NextParseState

func (n Node) NextParseState() StateID

NextParseState reports the state reached after the node.

func (Node) NextSibling

func (n Node) NextSibling() Node

NextSibling returns the next visible node with the same parent.

func (Node) Parent

func (n Node) Parent() Node

Parent returns the node that contains this.

func (Node) ParseState

func (n Node) ParseState() StateID

ParseState reports the parse state the node was created in.

func (Node) PrevNamedSibling

func (n Node) PrevNamedSibling() Node

PrevNamedSibling returns the named node with the same parent.

func (Node) PrevSibling

func (n Node) PrevSibling() Node

PrevSibling returns the visible node with the same parent.

func (Node) StartByte

func (n Node) StartByte() uint32

StartByte reports the node's earliest byte offset.

func (Node) StartPoint

func (n Node) StartPoint() Point

StartPoint reports the node's earliest row and column.

func (Node) String

func (n Node) String() string

String renders the node as an S expression.

func (Node) Symbol

func (n Node) Symbol() Symbol

Symbol reports the node's public grammar symbol. A null node has none.

func (Node) Tree

func (n Node) Tree() *Tree

Tree reports the tree that owns the node.

func (Node) Type

func (n Node) Type() string

Type reports the node's grammar rule name. A null node has none.

func (Node) Walk

func (n Node) Walk() *TreeCursor

Walk returns a cursor positioned on the node.

type ParseAction

type ParseAction struct {
	Type              uint8
	State             StateID
	Extra             bool
	Repetition        bool
	ChildCount        uint8
	Symbol            Symbol
	DynamicPrecedence int16
	ProductionID      uint16
}

ParseAction is a single entry of a parse table cell.

type ParseActionEntry

type ParseActionEntry struct {
	Action   ParseAction
	Count    uint8
	Reusable bool
}

ParseActionEntry is either a group header or a single action.

type Parser

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

Parser turns source text into a syntax tree.

func NewParser

func NewParser() *Parser

NewParser creates a parser with no language assigned.

func (*Parser) IncludedRanges

func (p *Parser) IncludedRanges() []Range

IncludedRanges reports the regions the parser reads.

func (*Parser) Language

func (p *Parser) Language() *Language

Language reports the grammar this parser uses.

func (*Parser) Parse

func (p *Parser) Parse(oldTree *Tree, input Input) *Tree

Parse builds a syntax tree from the given input.

func (*Parser) ParseString

func (p *Parser) ParseString(oldTree *Tree, source []byte) *Tree

ParseString builds a syntax tree from a source string.

func (*Parser) Reset

func (p *Parser) Reset()

Reset clears any parse state left over from a previous call.

func (*Parser) SetIncludedRanges

func (p *Parser) SetIncludedRanges(ranges []Range) bool

SetIncludedRanges restricts parsing to the given regions.

func (*Parser) SetLanguage

func (p *Parser) SetLanguage(language *Language) bool

SetLanguage assigns the grammar this parser uses.

type Point

type Point struct {
	Row    uint32
	Column uint32
}

Point is a row/column position in a document.

type Range

type Range struct {
	StartPoint Point
	EndPoint   Point
	StartByte  uint32
	EndByte    uint32
}

Range is a contiguous region of a document.

type StateID

type StateID = uint16

StateID identifies a parse state.

type Symbol

type Symbol = uint16

Symbol identifies a terminal or non-terminal in a grammar.

const BuiltinSymEnd Symbol = 0

BuiltinSymEnd is the symbol for the end of input.

const BuiltinSymError Symbol = 0xFFFF

BuiltinSymError is the symbol for an error node.

type SymbolMetadata

type SymbolMetadata struct {
	Visible   bool
	Named     bool
	Supertype bool
}

SymbolMetadata records how a symbol appears in a tree.

type Tables

type Tables struct {
	Language
	// CharacterSets holds the sets the lexer searches.
	CharacterSets [][]CharacterRange
	// Lex and KeywordLex are the grammar's lexer state machines.
	Lex        *LexProgram
	KeywordLex *LexProgram
}

The embedded Language's function fields and its scanner are not encoded.

func DecodeTables

func DecodeTables(blob []byte) (*Tables, error)

DecodeTables reads back what EncodeTables wrote.

type Tree

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

Tree is a syntax tree produced by a parser.

func (*Tree) Copy

func (t *Tree) Copy() *Tree

Copy returns a tree that shares the receiver's nodes.

func (*Tree) Edit

func (t *Tree) Edit(edit InputEdit)

Edit adjusts the tree's node positions to account for a change.

func (*Tree) IncludedRanges

func (t *Tree) IncludedRanges() []Range

IncludedRanges reports the regions the parser read.

func (*Tree) Language

func (t *Tree) Language() *Language

Language reports the grammar used to build the tree.

func (*Tree) RootNode

func (t *Tree) RootNode() Node

RootNode returns the tree's root.

func (*Tree) RootNodeWithOffset

func (t *Tree) RootNodeWithOffset(offsetBytes uint32, offsetExtent Point) Node

RootNodeWithOffset returns the root shifted by the given offset.

func (*Tree) String

func (t *Tree) String() string

String renders the tree as an S expression.

func (*Tree) Walk

func (t *Tree) Walk() *TreeCursor

Walk returns a cursor positioned on the tree's root.

type TreeCursor

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

TreeCursor walks a syntax tree. A step to a sibling costs the same at any index, because each level reads its children once.

func (*TreeCursor) Copy

func (c *TreeCursor) Copy() *TreeCursor

Copy returns an independent cursor at the same position.

func (*TreeCursor) Depth

func (c *TreeCursor) Depth() uint32

Depth reports how far the cursor has descended from its starting node.

func (*TreeCursor) FieldName

func (c *TreeCursor) FieldName() string

FieldName reports the field the current node fills in its parent.

func (*TreeCursor) GotoFirstChild

func (c *TreeCursor) GotoFirstChild() bool

GotoFirstChild moves to the earliest visible child, reporting whether a single exists.

func (*TreeCursor) GotoNextSibling

func (c *TreeCursor) GotoNextSibling() bool

GotoNextSibling moves to the next visible sibling, reporting whether a single exists.

func (*TreeCursor) GotoParent

func (c *TreeCursor) GotoParent() bool

GotoParent moves to the parent node, reporting whether a single exists.

func (*TreeCursor) GotoPreviousSibling

func (c *TreeCursor) GotoPreviousSibling() bool

GotoPreviousSibling moves to the visible sibling.

func (*TreeCursor) Node

func (c *TreeCursor) Node() Node

Node reports the node the cursor sits on.

func (*TreeCursor) Reset

func (c *TreeCursor) Reset(n Node)

Reset moves the cursor to the given node and forgets its history.

Directories

Path Synopsis
cmd
ts-fetch command
Command ts-fetch puts a grammar's upstream sources where ts-translate can read them.
Command ts-fetch puts a grammar's upstream sources where ts-translate can read them.
ts-goldens command
Command ts-goldens records the reference parse of a source file.
Command ts-goldens records the reference parse of a source file.
ts-translate command
Command ts-translate turns a tree-sitter generated parser.c into the table blob a grammar package embeds, and the loader that embeds it.
Command ts-translate turns a tree-sitter generated parser.c into the table blob a grammar package embeds, and the loader that embeds it.
grammars
clang
Package clang holds the tree-sitter grammar for the C language.
Package clang holds the tree-sitter grammar for the C language.
cpp
golang
Package golang holds the tree-sitter grammar for the Go language.
Package golang holds the tree-sitter grammar for the Go language.
tsx
Package tsx is TypeScript with JSX.
Package tsx is TypeScript with JSX.
internal
corpus
Package corpus reads the test corpus format that every tree-sitter grammar repository ships under test/corpus.
Package corpus reads the test corpus format that every tree-sitter grammar repository ships under test/corpus.
goldens
Package goldens compares parse results against files produced by the reference tree-sitter command line tool.
Package goldens compares parse results against files produced by the reference tree-sitter command line tool.
grammarsrc
Package grammarsrc puts a grammar's upstream sources where a translator can read them.
Package grammarsrc puts a grammar's upstream sources where a translator can read them.

Jump to

Keyboard shortcuts

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