Versions in this module Expand all Collapse all v0 v0.13.0 Nov 27, 2026 v0.12.0 Nov 27, 2026 v0.11.0 Nov 23, 2026 v0.10.0 Nov 19, 2026 v0.9.0 Nov 15, 2026 v0.8.1 Oct 23, 2026 v0.8.0 Oct 19, 2026 v0.7.1 Oct 17, 2026 v0.7.0 Oct 16, 2026 v0.6.0 Oct 16, 2026 Changes in this version type Rule + Names map[string]bool type StyleSpec + Names []string v0.5.0 Oct 15, 2026 Changes in this version + func StyleTags(specs []StyleSpec) (map[string][]Rule, error) type Parser + func (p *Parser) WithStyleTags(byName map[string][]Rule) *Parser + type StyleSpec struct + Selector string + Tags []*tags.Tag v0.4.0 Oct 15, 2026 Changes in this version + func Highlight(t *Tree, sets *TagSets, span func(from, to int, set *TagSet)) + type ChangedRange struct + FromA int + FromB int + ToA int + ToB int + type Config struct + Dialect string + Top string + type ContextTracker struct + Hash func(context any) int + NonStrict bool + Reduce func(context any, term int, s *Stack, in *InputStream) any + Reuse func(context any, node *Tree, s *Stack, in *InputStream) any + Shift func(context any, term int, s *Stack, in *InputStream) any + Start any + type DialectSpec struct + Name string + Offset int + type Externals struct + Context *ContextTracker + Specializers map[string]Specializer + Tokenizers map[string]Tokenizer + type Input struct + func (in Input) Read(from, to int) string + type InputStream struct + Next int + Pos int + func (in *InputStream) AcceptToken(term, endOffset int) + func (in *InputStream) AcceptTokenTo(term, endPos int) + func (in *InputStream) Advance(n int) int + func (in *InputStream) Peek(offset int) int + type LocalGroupSpec struct + Data string + ElseToken int + PrecTable int + type Mode int + const ModeInherit + const ModeNormal + const ModeOpaque + type Nest func(n *Node, in Input) *NestedParse + type NestedParse struct + Overlay []Range + Parser *Parser + type Node struct + func (n *Node) FirstChild() *Node + func (n *Node) From() int + func (n *Node) LastChild() *Node + func (n *Node) NextSibling() *Node + func (n *Node) Parent() *Node + func (n *Node) To() int + func (n *Node) Type() *NodeType + type NodeType struct + Error bool + ID int + Name string + Props map[string]string + Rules []Rule + Skipped bool + Top bool + func (t *NodeType) Anonymous() bool + type Parser struct + func New(spec Spec, ext Externals) (*Parser, error) + func (p *Parser) Configure(c Config) (*Parser, error) + func (p *Parser) Parse(text string) *Tree + func (p *Parser) ParseUnits(input []uint16, ranges []Range, fragments []TreeFragment) *Tree + func (p *Parser) Types() []NodeType + func (p *Parser) WithNest(nest Nest) *Parser + type Range struct + From int + To int + type Rule struct + Context []string + Mode Mode + Tags []*tags.Tag + type RuleSpec struct + Context []string + Mode Mode + Tags []string + type Spec struct + Context string + Dialects []DialectSpec + DynamicPrec map[int]int + Goto string + MaxTerm int + NodeNames string + NodeProps map[string]map[int]string + RepeatNodeCount int + SkippedNodes []int + Specialized []SpecializerSpec + StateData string + States string + Styles map[int][]RuleSpec + TokenData string + TokenPrec int + Tokenizers []TokenizerSpec + TopRules []TopRule + Version int + type Specializer func(text string, s *Stack) int + type SpecializerSpec struct + Extend bool + External string + Table map[string]int + Term int + type Stack struct + func (s *Stack) CanShift(term int) bool + func (s *Stack) Context() any + func (s *Stack) DialectEnabled(id int) bool + func (s *Stack) Pos() int + type TagSet struct + Tags []*tags.Tag + type TagSets struct + func NewTagSets() *TagSets + func (s *TagSets) Of(ts ...*tags.Tag) *TagSet + type Tokenizer struct + Contextual bool + Extend bool + Fallback bool + Token func(in *InputStream, s *Stack) + type TokenizerSpec struct + External string + Group int + Local *LocalGroupSpec + type TopRule struct + Name string + State int + Term int + type Tree struct + func (t *Tree) Layout() string + func (t *Tree) Length() int + func (t *Tree) String() string + func (t *Tree) Type() *NodeType + type TreeFragment struct + From int + Offset int + OpenEnd bool + OpenStart bool + To int + Tree *Tree + func AddTree(tree *Tree, fragments []TreeFragment, partial bool) []TreeFragment + func ApplyChanges(fragments []TreeFragment, changes []ChangedRange) []TreeFragment