tree_sitter
library
Classes
DartTreeSitterGrammar
Generated-language counterpart used by the example and default highlighter.
GeneratedChangedRangeLength
GeneratedChangedRangeTrace
Records direct calls and state outputs of the fourteen operations ported
from get_changed_ranges.c. It is optional and has no production overhead.
GeneratedEditedSubtreeState
Effective relative subtree fields after ts_subtree_edit.
GeneratedReusableNodeCursor
Depth-first cursor over reusable generated subtrees. The synthetic root is
intentionally never yielded, matching native Tree-sitter's reuse cursor.
GeneratedTreeSitterChangedRange
GeneratedTreeSitterField
GeneratedTreeSitterGrammar
Grammar backed by generated Tree-sitter parse tables executed in Dart.
GeneratedTreeSitterNode
GeneratedTreeSitterNodePosition
Effective position of a generated node after all tree edits.
GeneratedTreeSitterParser
GeneratedTreeSitterProductionField
GeneratedTreeSitterTree
JavaScriptTreeSitterGrammar
A pure-Dart scanner grammar for JavaScript and its TypeScript/JSX variants.
MutableTreeSitterCancellationToken
Mutable token useful when producer and parser execute in the same isolate.
Cross-isolate runtimes should implement TreeSitterCancellationToken with
their platform's shared cancellation primitive.
TreeSitterAllocator
The callback slots controlled by treeSitterSetAllocator .
TreeSitterArray <T >
Managed generic adaptation of Tree-sitter 0.25.10's Array(T).
TreeSitterAtomicUint32
Managed counterpart of Tree-sitter's small atomic counter helpers.
TreeSitterBufferTag
Flat TSTag representation stored by the C tags-buffer API.
TreeSitterByteRange
TreeSitterCancellationToken
A shareable cancellation contract for parser runtimes.
TreeSitterCBufferIterator <T >
An owning iterator over a C-style buffer and explicit element count.
TreeSitterCharacterRange
Managed value counterpart of native TSCharacterRange.
TreeSitterCHighlighter
Managed counterpart of the C facade's TSHighlighter registry.
TreeSitterCollectedInput
TreeSitterCustomEncodingInput
Collects callback input using Tree-sitter 0.25's custom decoder contract.
TreeSitterDecodedInputMap
Boundary map from the UTF-8 parser representation back to the caller's
original custom-encoded byte stream.
TreeSitterDecodeResult
One decoded scalar and the number of source bytes it consumed.
TreeSitterEditableInput
Editable piece-based UTF-8 input used by a persistent parser worker.
TreeSitterEditBatch
A revisioned sequence of edits, applied strictly in list order.
TreeSitterExternalLexer
Dart counterpart of Tree-sitter's TSLexer external-scanner surface.
TreeSitterExternalScanner <State >
TreeSitterExternalScannerDestroy <State >
Optional deterministic counterpart of an external scanner's native
destroy callback.
TreeSitterExternalScannerGoalRetry
Opts a scanner into retrying a failed speculative scan with one valid
external-token goal at a time.
TreeSitterExternalScannerPersistentPayload
Opts a scanner into reusing its native-style payload across scans.
TreeSitterFieldMapEntry
TreeSitterFieldMapSlice
TreeSitterGrammar
TreeSitterGrammarRevision
TreeSitterHighlight
Identifies an entry in a configured highlight-name table.
TreeSitterHighlightBuffer
Dart ownership wrapper for the C facade's TSHighlightBuffer.
TreeSitterHighlightCancellationToken
Mutable cancellation flag shared with one highlight operation.
TreeSitterHighlightConfiguration
Immutable language/query data consumed by TreeSitterHighlighter .
TreeSitterHighlightEnd
Ends the most recently started highlight.
TreeSitterHighlighter
Reusable highlighter state. The parser is retained across calls, matching
Tree-sitter's Highlighter; query cursors are managed Dart iterables.
TreeSitterHighlightEvent
One event in Tree-sitter's streaming highlight protocol.
TreeSitterHighlightItemResult
One HighlightIter item, preserving Rust's per-item Result contract.
TreeSitterHighlightSource
Emits source bytes in the half-open range start , end .
TreeSitterHighlightStart
Starts highlight .
TreeSitterHtmlHighlight
A configured highlight over a UTF-16 range of a Dart String .
TreeSitterHtmlRenderer
Converts Tree-sitter highlight events into a persistent HTML byte buffer.
TreeSitterInput
Random-access UTF-8 parser input.
TreeSitterInputEdit
One ordered source edit in the coordinate space produced by prior edits.
TreeSitterLanguageBinaryCodec
Compact, allocation-conscious codec for generated Tree-sitter tables.
TreeSitterLanguageBundle
Provenance and generated parse tables for one Tree-sitter grammar.
TreeSitterLanguageLookaheadIterator
Reusable view of terminal symbols accepted in one parse state.
TreeSitterLanguageMetadata
Semantic version metadata embedded by a generated Tree-sitter language.
TreeSitterLanguageTable
The generated grammar data needed by the native Dart lexer/parser.
TreeSitterLanguageTableEntry
Native-shaped result of ts_language_table_entry.
TreeSitterLexMode
TreeSitterLexState
TreeSitterLocalsConfiguration
TreeSitterLossyUtf8
Splits UTF-8 into the same valid runs and replacement items as Rust.
TreeSitterNativeInput
Exact value projection of native TSInput for the pure-Dart runtime.
TreeSitterNativeLogger
Exact value projection of native TSLogger.
TreeSitterNativeParseOptions
Exact value projection of native TSParseOptions.
TreeSitterNativeParseState
Exact value projection of the callback-owned native TSParseState.
TreeSitterNativeWasmError
Exact value projection of native TSWasmError.
TreeSitterNode
TreeSitterParseAction
TreeSitterParseActionEntry
TreeSitterParseOptions
TreeSitterParser
Pure-Dart incremental parser facade following Tree-sitter's tree API.
TreeSitterParserRuntimeHooks
Hooks the core runtime must consume to provide native cancellation,
resumable timeout, logging, and graph behavior.
TreeSitterParseState
State supplied by Tree-sitter 0.25 progress callbacks.
TreeSitterParseStateSnapshot
Immutable public value for a parser progress-callback checkpoint.
TreeSitterPoint
A zero-based Tree-sitter position. Columns are UTF-8 byte columns.
TreeSitterPointRange
TreeSitterQuery
A compiled capture query over the node kinds emitted by a grammar.
TreeSitterQueryCapture
TreeSitterQueryCaptureOffset
Signed Tree-sitter point deltas applied to one capture by #offset!.
TreeSitterQueryCaptureResult
One item from a lazy query-capture stream.
TreeSitterQueryCaptureStream
A one-shot query capture iterable whose range remains mutable while it is
being consumed.
TreeSitterQueryChildPattern
TreeSitterQueryChildRule
TreeSitterQueryCursor
Stateful range configuration for Tree-sitter query execution.
TreeSitterQueryCursorOptions
TreeSitterQueryCursorState
TreeSitterQueryGeneralPredicate
One predicate that is not interpreted by Tree-sitter's built-in text or
property predicate machinery.
TreeSitterQueryMatch
One complete Tree-sitter query match, retaining all capture bindings and
pattern-level #set! metadata.
TreeSitterQueryMatchStream
A one-shot query match iterable evaluated incrementally over the tree.
TreeSitterQueryNodePattern
One node expression in a structural query. An alternative expression has
alternatives , while _ is represented by isWildcard .
TreeSitterQueryNodeType
TreeSitterQueryNodeTypeRef
TreeSitterQueryPattern
TreeSitterQueryPredicate
A text or ancestry constraint attached to a compiled query capture.
TreeSitterQueryPredicateArg
TreeSitterQueryPredicateCaptureArg
TreeSitterQueryPredicateStep
One native TSQueryPredicateStep value.
TreeSitterQueryPredicateStringArg
TreeSitterQueryProperty
A key/value property associated with a compiled query pattern.
TreeSitterRange
One byte-and-point range accepted by Tree-sitter's included-range API.
TreeSitterRawHandle <T extends Object >
A single-owner pure-Dart counterpart of an opaque native pointer.
TreeSitterReduceAction
Managed field-for-field counterpart of native ReduceAction.
TreeSitterReduceActionSet
Ordered native-style ReduceActionSet backed by the managed Array(T).
TreeSitterScmAtom
TreeSitterScmExpression
TreeSitterScmHighlightQueryCompiler
Compiles the structurally safe subset of a Tree-sitter highlights.scm
query into the Dart query model.
TreeSitterScmList
TreeSitterScmParser
Pure-Dart parser for Tree-sitter's Scheme query syntax.
TreeSitterScmQueryParityAudit
AST-derived feature inventory for one Tree-sitter query document.
TreeSitterScmQueryParityAuditor
Audits the exact operators, predicates, directives, and special selectors
accepted by TreeSitterScmHighlightQueryCompiler .
TreeSitterScmString
TreeSitterScmUnsupportedConstruct
TreeSitterStreamingDecodedInput
Demand-driven adapter from a native physical-byte input to the UTF-8 byte
stream consumed by the generated Dart parser.
TreeSitterStructuralQueryPattern
A complete structural query pattern used when a Scheme query contains
sibling anchors or quantifiers and cannot be represented as one contextual
capture.
TreeSitterStructuralQueryPredicate
TreeSitterSymbolMetadata
TreeSitterSyntaxWorkerEngine
Pure-Dart syntax pipeline owned by a background isolate or Web Worker.
TreeSitterTablePoint
TreeSitterTableRange
A byte/point interval exposed to the lexer as parser input.
TreeSitterTableToken
TreeSitterTag
One definition or reference produced by a Tree-sitter tags query.
TreeSitterTagger
Owned counterpart of TSTagger and its scope-name language registry.
TreeSitterTagsBuffer
Owned counterpart of TSTagsBuffer and its C accessor functions.
TreeSitterTagsCancellationToken
Mutable cancellation flag checked between yielded tags.
TreeSitterTagsConfiguration
Compiled tags and locals queries for one generated Dart grammar.
TreeSitterTagsContext
Reusable tag-generation context matching Tree-sitter 0.25's tags surface.
TreeSitterTagsItemResult
Lazy tag stream plus the parse-error status of its source tree.
TreeSitterTagsNamedCapture
The syntax kind and role assigned to a named tags-query capture.
TreeSitterTagsResult
Lazy per-item results plus the parse-error status of the source tree.
TreeSitterTree
TreeSitterTreeCursor
Mutable cursor matching Tree-sitter's visible-node traversal semantics.
TreeSitterTreeCursorStatus
Query-facing facts computed by C's ts_tree_cursor_current_status.
TreeSitterUtf16Input
TreeSitterUtf16Offset
A typed UTF-16 code-unit offset into Tree-sitter source text.
TreeSitterUtf16Range
An immutable, half-open UTF-16 source range: [start, end).
TreeSitterUtf8Input
TreeSitterVersionedGrammar
Grammar whose generated Tree-sitter ABI version can be validated.
TreeSitterWasmDylinkInfo
The dylink.0 memory-info subsection used by Tree-sitter Wasm grammars.
TreeSitterWasmEngine
Host-provided WebAssembly engine boundary.
TreeSitterWasmInstantiation
TreeSitterWasmLanguage
Reference-counted language returned from a Wasm store.
TreeSitterWasmLanguageInstance
TreeSitterWasmModule
TreeSitterWasmResolvedImport
Result of the import-name policy used while instantiating a grammar.
TreeSitterWasmRuntime
TreeSitterWasmRuntimeConfiguration
TreeSitterWasmStore
Pure-Dart lifecycle and policy layer for a Tree-sitter Wasm store.
TSClock
Managed adaptation of Tree-sitter 0.25.10's monotonic TSClock.
TSDuration
Managed adaptation of Tree-sitter 0.25.10's TSDuration.
Functions
clockAfter (TSClock base , TSDuration duration )
→ TSClock
Tree-sitter 0.25.10 clock_after for a normalized monotonic timespec.
clockIsGt (TSClock clock , TSClock other )
→ bool
Tree-sitter 0.25.10 strict lexicographic clock_is_gt comparison.
clockIsNull (TSClock clock )
→ bool
Tree-sitter 0.25.10 clock_is_null for the monotonic pair.
clockNow ()
→ TSClock
Tree-sitter 0.25.10 clock_now, adapted to Dart's monotonic stopwatch.
clockNull ()
→ TSClock
Tree-sitter 0.25.10 clock_null on CLOCK_MONOTONIC platforms.
durationFromMicros (BigInt microseconds )
→ TSDuration
Tree-sitter 0.25.10 duration_from_micros on CLOCK_MONOTONIC platforms.
durationToMicros (TSDuration duration )
→ BigInt
Tree-sitter 0.25.10 duration_to_micros on CLOCK_MONOTONIC platforms.
generatedChangedRangeHiddenIteratorAuditScenario (dynamic language , {GeneratedChangedRangeTrace ? trace })
→ String
Direct oracle for the invisible-root sentinel branch of
iterator_get_visible_state and iterator_tree_is_visible.
generatedChangedRangeIteratorAuditScenario (GeneratedTreeSitterTree oldTree , GeneratedTreeSitterNode newRoot , {int ? newRootTotalEndByte , TreeSitterTablePoint ? newRootTotalEndPoint })
→ List <String >
Produces the same direct iterator transition transcript as
native_tree_sitter_0_25_changed_ranges_oracle.c.
generatedChangedRanges (GeneratedTreeSitterTree oldTree , GeneratedTreeSitterNode newRoot , {List <TreeSitterTableRange > newIncludedRanges = const [] , int ? newRootTotalEndByte , TreeSitterTablePoint ? newRootTotalEndPoint , GeneratedChangedRangeTrace ? trace })
→ List <GeneratedTreeSitterChangedRange >
Compares an edited old generated tree with a newly parsed tree and returns
the minimal structurally changed generated-node ranges.
generatedIncludedRangeDifferences (List <TreeSitterTableRange > oldRanges , List <TreeSitterTableRange > newRanges , {GeneratedChangedRangeTrace ? trace })
→ List <GeneratedTreeSitterChangedRange >
generatedRangeArrayAdd (List <GeneratedTreeSitterChangedRange > ranges , GeneratedChangedRangeLength start , GeneratedChangedRangeLength end , {GeneratedChangedRangeTrace ? trace })
→ void
generatedRangeArrayIntersects (List <GeneratedTreeSitterChangedRange > ranges , int startIndex , int startByte , int endByte , {GeneratedChangedRangeTrace ? trace })
→ bool
generatedSubtreeArrayClear (List <GeneratedTreeSitterNode > values )
→ void
generatedSubtreeArrayCopy (List <GeneratedTreeSitterNode > source )
→ List <GeneratedTreeSitterNode >
generatedSubtreeArrayReverse (List <GeneratedTreeSitterNode > values )
→ void
generatedSubtreeCompare (GeneratedTreeSitterNode left , GeneratedTreeSitterNode right )
→ int
Exact symbol/child-count/pre-order comparison used by
ts_subtree_compare. Source coordinates and other metadata deliberately
do not participate.
generatedSubtreeCompress (GeneratedTreeSitterNode self , int count , {Set <GeneratedTreeSitterNode > sharedNodes = const <GeneratedTreeSitterNode>{} })
→ GeneratedTreeSitterNode
Immutable counterpart of Tree-sitter 0.25.10's
ts_subtree_compress rotation.
generatedSubtreeExternalScannerStateEquals (List <int > left , List <int > right )
→ bool
Managed counterpart of the native external-scanner state equality helper.
generatedSubtreeHasTrailingEmptyDescendant (GeneratedTreeSitterNode self , GeneratedTreeSitterNode other )
→ bool
Exact managed counterpart of the private node.c helper used to disambiguate
zero-width previous siblings.
generatedSubtreeLastExternalToken (GeneratedTreeSitterNode tree )
→ GeneratedTreeSitterNode ?
Returns the right-most external-token leaf, matching
ts_subtree_last_external_token.
generatedSubtreeRepeatDepth (GeneratedTreeSitterNode node )
→ int
treeSitterArray025ParityProbe ()
→ List <String >
Deterministic managed transcript corresponding to the pinned native
Tree-sitter 0.25.10 array.h oracle.
treeSitterCharacterRangeSetContains (List <TreeSitterCharacterRange > ranges , int lookahead )
→ bool
Exact binary-search contract of Tree-sitter 0.25.10 set_contains.
treeSitterClock025ParityProbe ()
→ List <String >
Deterministic managed transcript corresponding to the pinned native
macOS CLOCK_MONOTONIC oracle.
treeSitterCopyWasmStrings (Uint8List memory , int arrayAddress , int count )
→ List <Uint8List ? >
Copies a table of wasm32 string pointers as independent NUL-free bytes.
treeSitterCopyWasmUnsizedStaticArray (Uint8List memory , int startAddress , Iterable <int > allAddresses )
→ Uint8List ?
Copies the static byte region ending at the nearest greater Wasm address.
treeSitterDecode (TreeSitterCustomDecoder decoder , List <int > bytes )
→ TreeSitterDecodeResult
Invokes a custom decoder with the borrowed input slice unchanged.
treeSitterDefaultAllocator025ParityProbe ()
→ Map <String , Object ? >
Function-boundary probe for the three default functions in alloc.c.
treeSitterFormatSExpression (String sExpression , [int initialIndentLevel = 0 ])
→ String
Formats a compact Tree-sitter S-expression using the exact 0.25 state
machine used by Rust's hidden format_sexp helper.
treeSitterManagedParserCoreAuditProbe ()
→ Map <String , Object ? >
Deterministic audit surface for managed-only parser value objects.
treeSitterParseWasmDylinkInfo (List <int > bytes )
→ TreeSitterWasmDylinkInfo ?
Parses the WebAssembly dylink.0 memory-info subsection.
treeSitterPointLength025ParityProbe ()
→ List <String >
Pinned Tree-sitter 0.25.10 point.h/length.h behavior transcript.
treeSitterReleaseWasmLanguageTable (TreeSitterLanguageTable language )
→ void
treeSitterResetAllocator ()
→ void
Restores all four allocator callback slots to their Dart defaults.
treeSitterResolveWasmImport (String importName )
→ TreeSitterWasmResolvedImport ?
Resolves an import using wasm_store.c's pinned name_eq behavior.
treeSitterRetainWasmLanguageTable (TreeSitterLanguageTable language )
→ bool
treeSitterRuntimeDecodeUtf16BigEndian (List <int > bytes )
→ TreeSitterDecodeResult
Pinned U16_NEXT_BE behavior used by the native UTF-16BE lexer path.
treeSitterRuntimeDecodeUtf16LittleEndian (List <int > bytes )
→ TreeSitterDecodeResult
Pinned U16_NEXT_LE behavior used by the native UTF-16LE lexer path.
treeSitterRuntimeDecodeUtf8 (List <int > bytes )
→ TreeSitterDecodeResult
Pinned ICU U8_NEXT behavior used by generated and external lexer paths.
treeSitterSetAllocator ({TreeSitterMallocFunction ? malloc , TreeSitterCallocFunction ? calloc , TreeSitterReallocFunction ? realloc , TreeSitterFreeFunction ? free })
→ void
Installs Tree-sitter allocation callbacks, resetting every null slot to its
default just like ts_set_allocator.
treeSitterStack025ParityProbe ()
→ Map <String , Object ? >
treeSitterSubtree025ParityProbe ()
→ Map <String , Object ? >
Runs deterministic state transitions through the actual managed GSS types.
Direct managed semantic transcript for every inline helper in the pinned
Tree-sitter 0.25.10 subtree.h.
treeSitterTextProviderForByteSlice (Uint8List bytes )
→ TreeSitterQueryTextProvider
Creates Rust's TextProvider for &[u8] counterpart.
treeSitterValidateGrammarJson (String source )
→ void
Validates the lexical-empty-rule failures rejected by Tree-sitter 0.25.
treeSitterWasmIsInitializerExport (String exportName )
→ bool
Whether an exported function is called as a module initializer.
treeSitterWasmStdlibSymbols ()
→ Iterable <String >
Symbols supplied by Tree-sitter's embedded Wasm C standard library.
Typedefs
TreeSitterByteInputCallback
= List <int > Function(int byteOffset , TreeSitterPoint position )
Native-shaped callback input for a caller-defined byte encoding.
TreeSitterCallocFunction
= Object ? Function(int count , int size )
Dart counterpart of Tree-sitter's TSCalloc callback.
TreeSitterCustomDecoder
= TreeSitterDecodeResult Function(List <int > bytes )
Decodes the first scalar in bytes. A zero-byte result is end of input.
TreeSitterDebugGraphSink
= void Function(String dotFragment )
TreeSitterDecodeFunction
= TreeSitterDecodeResult Function(List <int > bytes )
Native DecodeFunction callback shape without an FFI pointer dependency.
TreeSitterFieldId
= int
Native TSFieldId value. Generated tables constrain values to uint16_t.
TreeSitterFreeFunction
= void Function(Object ? buffer )
Dart counterpart of Tree-sitter's TSFree callback.
TreeSitterHighlightAttributeCallback
= void Function(TreeSitterHighlight highlight , List <int > html )
TreeSitterHighlightInjectionCallback
= TreeSitterHighlightConfiguration ? Function(String languageName )
TreeSitterLanguageBuilder
= TreeSitterLanguageTable Function()
Generated-language factory equivalent to Rust's LanguageFn wrapper.
TreeSitterLogger
= void Function(TreeSitterLogType type , String message )
TreeSitterMallocFunction
= Object ? Function(int size )
Dart counterpart of Tree-sitter's TSMalloc callback.
TreeSitterNativeInputRead
= List <int > Function(Object ? payload , int byteOffset , TreeSitterPoint position )
Native TSInput.read callback shape.
TreeSitterNativeLogCallback
= void Function(Object ? payload , TreeSitterLogType type , String message )
TreeSitterNativeProgressCallback
= bool Function(TreeSitterNativeParseState state )
TreeSitterParserInternalTrace
= void Function(String dotFragment )
Receives the pinned C-runtime name of each parser helper as its managed
counterpart executes.
TreeSitterProgressCallback
= bool Function(TreeSitterParseState state )
Returning true halts parsing and returns no tree. The runtime calls this
during parsing and final tree balancing.
TreeSitterQueryProgressCallback
= bool Function(TreeSitterQueryCursorState state )
TreeSitterQueryTextProvider
= Iterable <List <int > > Function(TreeSitterNode node )
Supplies UTF-8 source chunks for a query capture candidate.
TreeSitterReallocFunction
= Object ? Function(Object ? buffer , int size )
Dart counterpart of Tree-sitter's TSRealloc callback.
TreeSitterStackVersion
= int
Managed scalar counterpart of native unsigned StackVersion.
TreeSitterStateId
= int
Native TSStateId value. Generated tables constrain values to uint16_t.
TreeSitterSymbol
= int
Native TSSymbol value. Generated tables constrain values to uint16_t.
TreeSitterUtf16InputCallback
= List <int > Function(int byteOffset , TreeSitterPoint position )
Native-shaped callback input for UTF-16 parsing.
TreeSitterUtf8InputCallback
= List <int > Function(int byteOffset , TreeSitterPoint position )
Native-shaped callback input for UTF-8 parsing.