moonbit-community/treesitter/runtime does not have a README file

    DecodeFunction

    type DecodeFunction = (BytesView) -> (UInt, Int)

    TSDecodeFunction: decode one code point from the start of string, returning (bytes consumed, code point); the code point is -1 when the input is invalid.

    ExternalScannerFactory

    type ExternalScannerFactory = () -> ExternalScanner

    create().

    Logger

    type Logger = (LogType, String) -> Unit

    TSLogger.

    StackSummary

    type StackSummary = Array[StackSummaryEntry]

    An Array is a collection of values that supports random access and can grow in size.

    StackVersion

    type StackVersion = Int

    CursorStatus

    pub(all) struct CursorStatus {
    field_id : Int
    has_later_siblings : Bool
    has_later_named_siblings : Bool
    can_have_later_siblings_with_this_field : Bool
    supertypes : Array[Int]
    }

    The result of ts_tree_cursor_current_status.

    ExternalScanner

    pub(all) struct ExternalScanner {
    scan : (Lexer, ArrayView[Bool]) -> Bool
    serialize : (FixedArray[Byte]) -> Int
    deserialize : (BytesView) -> Unit
    destroy : () -> Unit
    }

    Input

    pub(all) struct Input {
    read : (UInt, Point) -> BytesView
    encoding : InputEncoding
    decode : (BytesView) -> (UInt, Int)?
    }

    TSInput. read(byte_index, position) returns the chunk of text starting at byte_index; an empty chunk signals the end of the input.

    InputEdit

    pub(all) struct InputEdit {
    start_byte : UInt
    old_end_byte : UInt
    new_end_byte : UInt
    start_point : Point
    old_end_point : Point
    new_end_point : Point
    } derive(Eq,
    Debug
    )

    InputEncoding

    pub(all) enum InputEncoding {
    UTF8
    UTF16LE
    UTF16BE
    Custom
    } derive(Eq,
    Debug
    )

    Length

    pub(all) struct Length {
    bytes : UInt
    extent : Point
    } derive(Eq, Hash,
    Debug
    )

    Lexer

    pub(all) struct Lexer {
    lookahead : Int
    result_symbol : Int
    // private fields
    }

    The lexer state. Its public methods form the TSLexer interface used by lex functions and external scanners.

    Lexer::advance

    fn Lexer::advance(self : Lexer, skip : Bool) -> Unit

    TSLexer.advance: advance to the next character in the source code, retrieving a new chunk of source code if needed.

    Lexer::current_position

    fn Lexer::current_position(self : Lexer) -> Length

    Lexer::did_get_column

    fn Lexer::did_get_column(self : Lexer) -> Bool

    Lexer::eof

    fn Lexer::eof(self : Lexer) -> Bool

    ts_lexer__eof: the lexer has consumed all of its available ranges.

    Lexer::finish

    fn Lexer::finish(self : Lexer, lookahead_end_byte : UInt) -> UInt

    ts_lexer_finish: returns the updated lookahead_end_byte.

    Lexer::get_column

    fn Lexer::get_column(self : Lexer) -> UInt

    TSLexer.get_column.

    Lexer::has_logger

    fn Lexer::has_logger(self : Lexer) -> Bool

    Lexer::included_ranges

    fn Lexer::included_ranges(self : Lexer) -> Array[Range]

    ts_lexer_included_ranges.

    Lexer::is_at_included_range_start

    fn Lexer::is_at_included_range_start(self : Lexer) -> Bool

    TSLexer.is_at_included_range_start: is the lexer at a boundary between two disjoint included ranges of source code?

    Lexer::log

    fn Lexer::log(self : Lexer, message : String) -> Unit

    TSLexer.log.

    Lexer::mark_end

    fn Lexer::mark_end(self : Lexer) -> Unit

    TSLexer.mark_end: mark that a token match has completed. This can be called multiple times if a longer match is found later.

    Lexer::new

    fn Lexer::new() -> Lexer

    ts_lexer_init.

    Lexer::reset

    fn Lexer::reset(self : Lexer, position : Length) -> Unit

    ts_lexer_reset: move the lexer to the given position. This doesn't do any work if the parser is already at the given position.

    Lexer::set_included_ranges

    fn Lexer::set_included_ranges(self : Lexer, ranges : Array[Range]) -> Bool

    ts_lexer_set_included_ranges.

    Lexer::set_input

    fn Lexer::set_input(self : Lexer, input : Input) -> Unit

    ts_lexer_set_input.

    Lexer::set_logger

    fn Lexer::set_logger(self : Lexer, logger : (LogType, String) -> Unit?) -> Unit

    Lexer::start

    fn Lexer::start(self : Lexer) -> Unit

    ts_lexer_start.

    Lexer::token_end_position

    fn Lexer::token_end_position(self : Lexer) -> Length

    Lexer::token_start_position

    fn Lexer::token_start_position(self : Lexer) -> Length

    LogType

    pub(all) enum LogType {
    Parse
    Lex
    } derive(Eq,
    Debug
    )

    Node

    pub struct Node {
    // private fields
    }

    TSNode: context holds the start byte, start point and alias; id is the subtree slot (None for the null node).
    impl Eq for Node

    Node::alias

    fn Node::alias(self : Node) -> Int

    Node::child

    fn Node::child(self : Node, child_index : UInt) -> Node

    ts_node_child.

    Node::child_by_field_id

    fn Node::child_by_field_id(self : Node, field_id : Int) -> Node

    ts_node_child_by_field_id.

    Node::child_by_field_name

    fn Node::child_by_field_name(self : Node, name : StringView) -> Node

    ts_node_child_by_field_name.

    Node::child_count

    fn Node::child_count(self : Node) -> UInt

    Node::child_with_descendant

    fn Node::child_with_descendant(self : Node, descendant : Node) -> Node

    ts_node_child_with_descendant.

    Node::descendant_count

    fn Node::descendant_count(self : Node) -> UInt

    Node::descendant_for_byte_range

    fn Node::descendant_for_byte_range(self : Node, start : UInt, end : UInt) -> Node

    Node::descendant_for_point_range

    fn Node::descendant_for_point_range(self : Node, start : Point, end : Point) -> Node

    Node::edit

    fn Node::edit(self : Node, edit : InputEdit) -> Node

    ts_node_edit: returns the edited node.

    Node::end_byte

    fn Node::end_byte(self : Node) -> UInt

    Node::end_point

    fn Node::end_point(self : Node) -> Point

    Node::field_name_for_child

    fn Node::field_name_for_child(self : Node, child_index : UInt) -> String?

    ts_node_field_name_for_child.

    Node::field_name_for_named_child

    fn Node::field_name_for_named_child(self : Node, named_child_index : UInt) -> String?

    ts_node_field_name_for_named_child.

    Node::first_child_for_byte

    fn Node::first_child_for_byte(self : Node, byte : UInt) -> Node

    Node::first_named_child_for_byte

    fn Node::first_named_child_for_byte(self : Node, byte : UInt) -> Node

    Node::grammar_kind

    fn Node::grammar_kind(self : Node) -> String

    ts_node_grammar_type.

    Node::grammar_symbol

    fn Node::grammar_symbol(self : Node) -> Int

    ts_node_grammar_symbol.

    Node::has_changes

    fn Node::has_changes(self : Node) -> Bool

    Node::has_error

    fn Node::has_error(self : Node) -> Bool

    Node::is_error

    fn Node::is_error(self : Node) -> Bool

    Node::is_extra

    fn Node::is_extra(self : Node) -> Bool

    Node::is_missing

    fn Node::is_missing(self : Node) -> Bool

    Node::is_named

    fn Node::is_named(self : Node) -> Bool

    Node::is_null

    fn Node::is_null(self : Node) -> Bool

    ts_node_is_null.

    Node::kind

    fn Node::kind(self : Node) -> String

    ts_node_type.

    Node::language

    ts_node_language.

    Node::named_child

    fn Node::named_child(self : Node, child_index : UInt) -> Node

    ts_node_named_child.

    Node::named_child_count

    fn Node::named_child_count(self : Node) -> UInt

    Node::named_descendant_for_byte_range

    fn Node::named_descendant_for_byte_range(self : Node, start : UInt, end : UInt) -> Node

    Node::named_descendant_for_point_range

    fn Node::named_descendant_for_point_range(self : Node, start : Point, end : Point) -> Node

    Node::new

    fn Node::new(tree : Tree?, subtree : SubtreeSlot?, position : Length, alias : Int) -> Node

    ts_node_new.

    Node::next_named_sibling

    fn Node::next_named_sibling(self : Node) -> Node

    Node::next_parse_state

    fn Node::next_parse_state(self : Node) -> Int

    Node::next_sibling

    fn Node::next_sibling(self : Node) -> Node

    Node::node_id

    fn Node::node_id(self : Node) -> UInt64

    ts_node_id: a value standing in for the subtree slot's address.

    Node::parent

    fn Node::parent(self : Node) -> Node

    ts_node_parent.

    Node::parse_state

    fn Node::parse_state(self : Node) -> Int

    Node::prev_named_sibling

    fn Node::prev_named_sibling(self : Node) -> Node

    Node::prev_sibling

    fn Node::prev_sibling(self : Node) -> Node

    Node::same_id

    fn Node::same_id(self : Node, other : Node) -> Bool

    Node::slot

    fn Node::slot(self : Node) -> SubtreeSlot?

    Node::start_byte

    fn Node::start_byte(self : Node) -> UInt

    Node::start_point

    fn Node::start_point(self : Node) -> Point

    Node::subtree

    fn Node::subtree(self : Node) -> Subtree

    ts_node__subtree.

    Node::symbol

    fn Node::symbol(self : Node) -> Int

    ts_node_symbol.

    Node::to_sexp

    fn Node::to_sexp(self : Node) -> String

    ts_node_string.

    Node::tree

    fn Node::tree(self : Node) -> Tree?

    ParseOptions

    pub(all) struct ParseOptions {
    progress_callback : (ParseState) -> Bool?
    }

    TSParseOptions.

    ParseState

    pub(all) struct ParseState {
    current_byte_offset : UInt
    has_error : Bool
    } derive(Eq,
    Debug
    )

    TSParseState: what a progress callback can observe.

    Parser

    pub struct Parser {
    // private fields
    }

    Parser::delete

    fn Parser::delete(self : Parser) -> Unit

    ts_parser_delete: release what the parser holds, destroying an outstanding external scanner (ts_parser_set_language(self, NULL)). MoonBit has no destructors, so callers do this explicitly; the parser is left without a language.

    Parser::included_ranges

    fn Parser::included_ranges(self : Parser) -> Array[Range]

    ts_parser_included_ranges.

    Parser::language

    ts_parser_language.

    Parser::logger

    fn Parser::logger(self : Parser) -> (LogType, String) -> Unit?

    ts_parser_logger.

    Parser::new

    fn Parser::new() -> Parser

    ts_parser_new.

    Parser::parse

    fn Parser::parse(self : Parser, old_tree : Tree?, input : Input) -> Tree?

    ts_parser_parse.

    Parser::parse_string

    fn Parser::parse_string(self : Parser, old_tree : Tree?, string : Bytes) -> Tree?

    ts_parser_parse_string.

    Parser::parse_string_encoding

    fn Parser::parse_string_encoding(self : Parser, old_tree : Tree?, string : Bytes, encoding : InputEncoding) -> Tree?

    ts_parser_parse_string_encoding.

    Parser::parse_with_options

    fn Parser::parse_with_options(self : Parser, old_tree : Tree?, input : Input, parse_options : ParseOptions) -> Tree?

    ts_parser_parse_with_options.

    Parser::print_dot_graphs

    fn Parser::print_dot_graphs(self : Parser, writer : (Bytes) -> Unit?) -> Unit

    ts_parser_print_dot_graphs: write parser debugging graphs to writer, or stop with None.

    Parser::reset

    fn Parser::reset(self : Parser) -> Unit

    ts_parser_reset.

    Parser::set_included_ranges

    fn Parser::set_included_ranges(self : Parser, ranges : Array[Range]) -> Bool

    ts_parser_set_included_ranges.

    Parser::set_language

    fn Parser::set_language(self : Parser, language :
    Language
    ?, scanner? : () -> ExternalScanner) -> Bool

    ts_parser_set_language. A language with external tokens needs the factory for its external scanner.

    Parser::set_logger

    fn Parser::set_logger(self : Parser, logger : (LogType, String) -> Unit?) -> Unit

    ts_parser_set_logger.

    Point

    pub(all) struct Point {
    row : UInt
    column : UInt
    } derive(Eq, Hash,
    Debug
    )

    TSPoint. Rows and columns are unsigned 32-bit values, as in C.

    Range

    pub(all) struct Range {
    start_point : Point
    end_point : Point
    start_byte : UInt
    end_byte : UInt
    } derive(Eq, Hash,
    Debug
    )

    Range::edit

    fn Range::edit(self : Range, edit : InputEdit) -> Range

    ts_range_edit.

    Stack

    pub struct Stack {
    // private fields
    }

    Stack::can_merge

    fn Stack::can_merge(self : Stack, version1 : Int, version2 : Int) -> Bool

    Stack::clear

    fn Stack::clear(self : Stack) -> Unit

    Stack::copy_version

    fn Stack::copy_version(self : Stack, version : Int) -> Int

    Stack::dynamic_precedence

    fn Stack::dynamic_precedence(self : Stack, version : Int) -> Int

    Stack::error_cost

    fn Stack::error_cost(self : Stack, version : Int) -> UInt

    Stack::get_summary

    fn Stack::get_summary(self : Stack, version : Int) -> Array[StackSummaryEntry]?

    Stack::halt

    fn Stack::halt(self : Stack, version : Int) -> Unit

    Stack::halted_version_count

    fn Stack::halted_version_count(self : Stack) -> Int

    Stack::has_advanced_since_error

    fn Stack::has_advanced_since_error(self : Stack, version : Int) -> Bool

    Stack::is_active

    fn Stack::is_active(self : Stack, version : Int) -> Bool

    Stack::is_halted

    fn Stack::is_halted(self : Stack, version : Int) -> Bool

    Stack::is_paused

    fn Stack::is_paused(self : Stack, version : Int) -> Bool

    Stack::last_external_token

    fn Stack::last_external_token(self : Stack, version : Int) -> Subtree

    Stack::merge

    fn Stack::merge(self : Stack, version1 : Int, version2 : Int) -> Bool

    Stack::new

    fn Stack::new() -> Stack

    ts_stack_new.

    Stack::node_count_since_error

    fn Stack::node_count_since_error(self : Stack, version : Int) -> UInt

    Stack::pause

    fn Stack::pause(self : Stack, version : Int, lookahead : Subtree) -> Unit

    Stack::pop_all

    fn Stack::pop_all(self : Stack, version : Int) -> Array[StackSlice]

    Stack::pop_count

    fn Stack::pop_count(self : Stack, version : Int, count : Int) -> Array[StackSlice]

    Stack::pop_error

    fn Stack::pop_error(self : Stack, version : Int) -> Array[Subtree]

    Stack::pop_pending

    fn Stack::pop_pending(self : Stack, version : Int) -> Array[StackSlice]

    Stack::position

    fn Stack::position(self : Stack, version : Int) -> Length

    Stack::print_dot_graph

    ts_stack_print_dot_graph. Node addresses are replaced by stable ids.

    Stack::push

    fn Stack::push(self : Stack, version : Int, subtree : Subtree, pending : Bool, state : Int) -> Unit

    Stack::record_summary

    fn Stack::record_summary(self : Stack, version : Int, max_depth : Int) -> Unit

    Stack::remove_version

    fn Stack::remove_version(self : Stack, version : Int) -> Unit

    Stack::renumber_version

    fn Stack::renumber_version(self : Stack, v1 : Int, v2 : Int) -> Unit

    Stack::resume

    fn Stack::resume(self : Stack, version : Int) -> Subtree

    Stack::set_last_external_token

    fn Stack::set_last_external_token(self : Stack, version : Int, token : Subtree) -> Unit

    Stack::state

    fn Stack::state(self : Stack, version : Int) -> Int

    Stack::swap_versions

    fn Stack::swap_versions(self : Stack, v1 : Int, v2 : Int) -> Unit

    Stack::version_count

    fn Stack::version_count(self : Stack) -> Int

    StackSlice

    pub(all) struct StackSlice {
    subtrees : Array[Subtree]
    version : Int
    }

    StackSummaryEntry

    pub(all) struct StackSummaryEntry {
    position : Length
    depth : Int
    state : Int
    } derive(Eq,
    Debug
    )

    Subtree

    #alias(MutableSubtree)
    pub(all) enum Subtree {
    Null
    Inline(SubtreeInlineData)
    Heap(SubtreeHeapData)
    }

    The fundamental building block of a syntax tree. Null is NULL_SUBTREE.

    Subtree::address

    fn Subtree::address(self : Subtree) -> Int

    A stable identity standing in for the pointer value (ts_node_id).

    Subtree::child_count

    fn Subtree::child_count(self : Subtree) -> Int

    Subtree::child_slot

    fn Subtree::child_slot(self : Subtree, index : Int) -> SubtreeSlot

    The slot of a parent's indexth child.

    Subtree::children

    fn Subtree::children(self : Subtree) -> Array[Subtree]

    Subtree::clone

    fn Subtree::clone(self : Subtree) -> Subtree

    ts_subtree_clone.

    Subtree::compare_to

    fn Subtree::compare_to(left : Subtree, right : Subtree) -> Int

    ts_subtree_compare.

    Subtree::compress

    fn Subtree::compress(self : Subtree, count : Int, language :
    Language
    , stack : Array[Subtree]) -> Unit

    ts_subtree_compress.

    Subtree::depends_on_column

    fn Subtree::depends_on_column(self : Subtree) -> Bool

    Subtree::dynamic_precedence

    fn Subtree::dynamic_precedence(self : Subtree) -> Int

    Subtree::edit

    fn Subtree::edit(self : Subtree, input_edit : InputEdit) -> Subtree

    ts_subtree_edit.

    Subtree::error_cost

    fn Subtree::error_cost(self : Subtree) -> UInt

    Subtree::external_scanner_state

    fn Subtree::external_scanner_state(self : Subtree) -> Bytes

    ts_subtree_external_scanner_state.

    Subtree::external_scanner_state_eq

    fn Subtree::external_scanner_state_eq(self : Subtree, other : Subtree) -> Bool

    ts_subtree_external_scanner_state_eq.

    Subtree::extra

    fn Subtree::extra(self : Subtree) -> Bool

    Subtree::fragile_left

    fn Subtree::fragile_left(self : Subtree) -> Bool

    Subtree::fragile_right

    fn Subtree::fragile_right(self : Subtree) -> Bool

    Subtree::has_changes

    fn Subtree::has_changes(self : Subtree) -> Bool

    Subtree::has_external_scanner_state_change

    fn Subtree::has_external_scanner_state_change(self : Subtree) -> Bool

    Subtree::has_external_tokens

    fn Subtree::has_external_tokens(self : Subtree) -> Bool

    Subtree::is_eof

    fn Subtree::is_eof(self : Subtree) -> Bool

    Subtree::is_error

    fn Subtree::is_error(self : Subtree) -> Bool

    Subtree::is_fragile

    fn Subtree::is_fragile(self : Subtree) -> Bool

    Subtree::is_inline

    fn Subtree::is_inline(self : Subtree) -> Bool

    Subtree::is_keyword

    fn Subtree::is_keyword(self : Subtree) -> Bool

    Subtree::is_null

    fn Subtree::is_null(self : Subtree) -> Bool

    Subtree::is_repetition

    fn Subtree::is_repetition(self : Subtree) -> Bool

    Subtree::last_external_token

    fn Subtree::last_external_token(self : Subtree) -> Subtree

    ts_subtree_last_external_token.

    Subtree::leaf_parse_state

    fn Subtree::leaf_parse_state(self : Subtree) -> Int

    Subtree::leaf_symbol

    fn Subtree::leaf_symbol(self : Subtree) -> Int

    Subtree::lookahead_bytes

    fn Subtree::lookahead_bytes(self : Subtree) -> UInt

    Subtree::make_mut

    fn Subtree::make_mut(self : Subtree) -> Subtree

    ts_subtree_make_mut: take ownership of the subtree. If it has only one owner it is converted directly; otherwise it is copied.

    Subtree::missing

    fn Subtree::missing(self : Subtree) -> Bool

    Subtree::named

    fn Subtree::named(self : Subtree) -> Bool

    Subtree::new_error

    fn Subtree::new_error(lookahead_char : Int, padding : Length, size : Length, bytes_scanned : UInt, parse_state : Int, language :
    Language
    ) -> Subtree

    ts_subtree_new_error.

    Subtree::new_error_node

    fn Subtree::new_error_node(children : Array[Subtree], extra : Bool, language :
    Language
    ) -> Subtree

    ts_subtree_new_error_node: this node is treated as 'extra'. Its children are prevented from having any effect on the parse state.

    Subtree::new_leaf

    fn Subtree::new_leaf(symbol : Int, padding : Length, size : Length, lookahead_bytes : UInt, parse_state : Int, has_external_tokens : Bool, depends_on_column : Bool, is_keyword : Bool, language :
    Language
    ) -> Subtree

    ts_subtree_new_leaf.

    Subtree::new_missing_leaf

    fn Subtree::new_missing_leaf(symbol : Int, state : Int, padding : Length, lookahead_bytes : UInt, language :
    Language
    ) -> Subtree

    ts_subtree_new_missing_leaf.

    Subtree::new_node

    fn Subtree::new_node(symbol : Int, children : Array[Subtree], production_id : Int, language :
    Language
    ) -> Subtree

    ts_subtree_new_node: create a new parent node with the given children. This takes ownership of the children array.

    Subtree::padding

    fn Subtree::padding(self : Subtree) -> Length

    Subtree::parse_state

    fn Subtree::parse_state(self : Subtree) -> Int

    Subtree::print_dot_graph

    ts_subtree_print_dot_graph. Node addresses are replaced by sequence numbers (paths would make the output quadratic in the tree depth).

    Subtree::production_id

    fn Subtree::production_id(self : Subtree) -> Int

    Subtree::ptr

    fn Subtree::ptr(self : Subtree) -> SubtreeHeapData

    self.ptr for a heap subtree. Aborts for inline/null subtrees, which C would dereference as an invalid pointer.

    Subtree::ptr_eq

    fn Subtree::ptr_eq(self : Subtree, other : Subtree) -> Bool

    a.ptr == b.ptr: identity for heap subtrees, bitwise equality for inline subtrees (whose data occupies the pointer word).

    Subtree::release

    fn Subtree::release(self : Subtree) -> Unit

    ts_subtree_release. Memory is reclaimed by the GC; the counts are kept so that make_mut and compress copy exactly when upstream does.

    Subtree::repeat_depth

    fn Subtree::repeat_depth(self : Subtree) -> UInt

    Subtree::retain

    fn Subtree::retain(self : Subtree) -> Unit

    ts_subtree_retain.

    Subtree::set_extra

    fn Subtree::set_extra(self : Subtree, is_extra : Bool) -> Subtree

    ts_subtree_set_extra.

    Subtree::set_symbol

    fn Subtree::set_symbol(self : Subtree, symbol : Int, language :
    Language
    ) -> Subtree

    ts_subtree_set_symbol.

    Subtree::size

    fn Subtree::size(self : Subtree) -> Length

    Subtree::summarize_children

    fn Subtree::summarize_children(self : Subtree, language :
    Language
    ) -> Unit

    ts_subtree_summarize_children: assign all of the node's properties that depend on its children.

    Subtree::symbol

    fn Subtree::symbol(self : Subtree) -> Int

    Subtree::to_sexp

    fn Subtree::to_sexp(self : Subtree, alias_symbol : Int, alias_is_named : Bool, language :
    Language
    , include_all : Bool) -> String

    ts_subtree_string: the S-expression for a subtree.

    Subtree::total_bytes

    fn Subtree::total_bytes(self : Subtree) -> UInt

    Subtree::total_size

    fn Subtree::total_size(self : Subtree) -> Length

    Subtree::visible

    fn Subtree::visible(self : Subtree) -> Bool

    Subtree::visible_child_count

    fn Subtree::visible_child_count(self : Subtree) -> UInt

    Subtree::visible_descendant_count

    fn Subtree::visible_descendant_count(self : Subtree) -> UInt

    SubtreeHeapData

    pub(all) struct SubtreeHeapData {
    ref_count : Int
    padding : Length
    size : Length
    lookahead_bytes : UInt
    error_cost : UInt
    children : Array[Subtree]
    symbol : Int
    parse_state : Int
    visible : Bool
    named : Bool
    extra : Bool
    fragile_left : Bool
    fragile_right : Bool
    has_changes : Bool
    has_external_tokens : Bool
    has_external_scanner_state_change : Bool
    depends_on_column : Bool
    is_missing : Bool
    is_keyword : Bool
    visible_child_count : UInt
    named_child_count : UInt
    visible_descendant_count : UInt
    dynamic_precedence : Int
    repeat_depth : UInt
    production_id : Int
    first_leaf_symbol : Int
    first_leaf_parse_state : Int
    external_scanner_state : Bytes
    lookahead_char : Int
    address : Int
    }

    SubtreeInlineData

    pub(all) struct SubtreeInlineData {
    visible : Bool
    named : Bool
    extra : Bool
    has_changes : Bool
    is_missing : Bool
    is_keyword : Bool
    depends_on_column : Bool
    symbol : Int
    parse_state : Int
    padding_columns : UInt
    padding_rows : UInt
    lookahead_bytes : UInt
    padding_bytes : UInt
    size_bytes : UInt
    } derive(Eq,
    Debug
    )

    SubtreeSlot

    pub(all) struct SubtreeSlot {
    array : Array[Subtree]
    index : Int
    owner : Int
    }

    A const Subtree *: a slot in a parent's children array (or a tree's root). Upstream compares these pointers to tell nodes apart, so slots are compared by array identity and index.

    SubtreeSlot::get

    fn SubtreeSlot::get(self : SubtreeSlot) -> Subtree

    SubtreeSlot::same

    fn SubtreeSlot::same(self : SubtreeSlot, other : SubtreeSlot) -> Bool

    Tree

    pub struct Tree {
    language :
    Language

    // private fields
    }

    Tree::changed_ranges

    fn Tree::changed_ranges(old_tree : Tree, new_tree : Tree) -> Array[Range]

    ts_tree_get_changed_ranges.

    Tree::copy

    fn Tree::copy(self : Tree) -> Tree

    ts_tree_copy.

    Tree::delete

    fn Tree::delete(self : Tree) -> Unit

    ts_tree_delete: release this tree's reference to its syntax.

    Tree::edit

    fn Tree::edit(self : Tree, edit : InputEdit) -> Unit

    ts_tree_edit.

    Tree::included_ranges

    fn Tree::included_ranges(self : Tree) -> Array[Range]

    ts_tree_included_ranges.

    Tree::language

    ts_tree_language.

    Tree::new

    fn Tree::new(root : Subtree, language :
    Language
    , included_ranges : Array[Range]) -> Tree

    ts_tree_new.

    Tree::print_dot_graph

    fn Tree::print_dot_graph(self : Tree, f :
    Buffer
    ) -> Unit

    ts_tree_print_dot_graph.

    Tree::root

    fn Tree::root(self : Tree) -> Subtree

    Tree::root_node

    fn Tree::root_node(self : Tree) -> Node

    ts_tree_root_node.

    Tree::root_node_with_offset

    fn Tree::root_node_with_offset(self : Tree, offset_bytes : UInt, offset_extent : Point) -> Node

    ts_tree_root_node_with_offset.

    TreeCursor

    pub struct TreeCursor {
    // private fields
    }

    TreeCursor::copy

    fn TreeCursor::copy(self : TreeCursor) -> TreeCursor

    ts_tree_cursor_copy.

    TreeCursor::current_depth

    fn TreeCursor::current_depth(self : TreeCursor) -> UInt

    ts_tree_cursor_current_depth.

    TreeCursor::current_descendant_index

    fn TreeCursor::current_descendant_index(self : TreeCursor) -> UInt

    ts_tree_cursor_current_descendant_index.

    TreeCursor::current_field_id

    fn TreeCursor::current_field_id(self : TreeCursor) -> Int

    ts_tree_cursor_current_field_id.

    TreeCursor::current_field_name

    fn TreeCursor::current_field_name(self : TreeCursor) -> String?

    ts_tree_cursor_current_field_name.

    TreeCursor::current_node

    fn TreeCursor::current_node(self : TreeCursor) -> Node

    ts_tree_cursor_current_node.

    TreeCursor::current_status

    fn TreeCursor::current_status(self : TreeCursor, max_supertypes : Int) -> CursorStatus

    ts_tree_cursor_current_status: facts about the current node that are needed when executing tree queries. can_have_later_siblings_with_this_field is never false when a later sibling has the current node's field, but can be true when none does.

    TreeCursor::current_subtree

    fn TreeCursor::current_subtree(self : TreeCursor) -> Subtree

    TreeCursor::entries

    fn TreeCursor::entries(self : TreeCursor) -> Array[TreeCursorEntry]

    TreeCursor::goto_descendant

    fn TreeCursor::goto_descendant(self : TreeCursor, goal_descendant_index : UInt) -> Unit

    ts_tree_cursor_goto_descendant.

    TreeCursor::goto_first_child

    fn TreeCursor::goto_first_child(self : TreeCursor) -> Bool

    ts_tree_cursor_goto_first_child.

    TreeCursor::goto_first_child_for_byte

    fn TreeCursor::goto_first_child_for_byte(self : TreeCursor, goal_byte : UInt) -> Int64

    ts_tree_cursor_goto_first_child_for_byte.

    TreeCursor::goto_first_child_for_point

    fn TreeCursor::goto_first_child_for_point(self : TreeCursor, goal_point : Point) -> Int64

    ts_tree_cursor_goto_first_child_for_point.

    TreeCursor::goto_first_child_internal

    fn TreeCursor::goto_first_child_internal(self : TreeCursor) -> TreeCursorStep

    TreeCursor::goto_last_child

    fn TreeCursor::goto_last_child(self : TreeCursor) -> Bool

    ts_tree_cursor_goto_last_child.

    TreeCursor::goto_last_child_internal

    fn TreeCursor::goto_last_child_internal(self : TreeCursor) -> TreeCursorStep

    TreeCursor::goto_next_sibling

    fn TreeCursor::goto_next_sibling(self : TreeCursor) -> Bool

    ts_tree_cursor_goto_next_sibling.

    TreeCursor::goto_next_sibling_internal

    fn TreeCursor::goto_next_sibling_internal(self : TreeCursor) -> TreeCursorStep

    TreeCursor::goto_parent

    fn TreeCursor::goto_parent(self : TreeCursor) -> Bool

    ts_tree_cursor_goto_parent.

    TreeCursor::goto_previous_sibling

    fn TreeCursor::goto_previous_sibling(self : TreeCursor) -> Bool

    ts_tree_cursor_goto_previous_sibling.

    TreeCursor::goto_previous_sibling_internal

    fn TreeCursor::goto_previous_sibling_internal(self : TreeCursor) -> TreeCursorStep

    TreeCursor::new

    fn TreeCursor::new(node : Node) -> TreeCursor

    ts_tree_cursor_new.

    TreeCursor::parent_node

    fn TreeCursor::parent_node(self : TreeCursor) -> Node

    ts_tree_cursor_parent_node.

    TreeCursor::reset

    fn TreeCursor::reset(self : TreeCursor, node : Node) -> Unit

    ts_tree_cursor_reset.

    TreeCursor::reset_to

    fn TreeCursor::reset_to(self : TreeCursor, src : TreeCursor) -> Unit

    ts_tree_cursor_reset_to.

    TreeCursor::tree

    fn TreeCursor::tree(self : TreeCursor) -> Tree?

    TreeCursorEntry

    pub(all) struct TreeCursorEntry {
    subtree : SubtreeSlot
    position : Length
    child_index : Int
    structural_child_index : Int
    descendant_index : UInt
    }

    TreeCursorStep

    pub(all) enum TreeCursorStep {
    StepNone
    StepHidden
    StepVisible
    } derive(Eq,
    Debug
    )

    decode_utf16_be

    fn decode_utf16_be(string : BytesView) -> (UInt, Int)

    ts_decode_utf16_be.

    decode_utf16_le

    fn decode_utf16_le(string : BytesView) -> (UInt, Int)

    ts_decode_utf16_le.

    decode_utf8

    fn decode_utf8(string : BytesView) -> (UInt, Int)

    ts_decode_utf8: ICU U8_NEXT with U_SENTINEL substitution.

    error_cost_per_missing_tree

    let error_cost_per_missing_tree : UInt

    error_cost_per_recovery

    let error_cost_per_recovery : UInt

    error_cost_per_skipped_char

    let error_cost_per_skipped_char : UInt

    error_cost_per_skipped_line

    let error_cost_per_skipped_line : UInt

    error_cost_per_skipped_tree

    let error_cost_per_skipped_tree : UInt

    error_state

    let error_state : Int

    external_scanner_state_eq

    fn external_scanner_state_eq(state : Bytes, buffer : BytesView) -> Bool

    ts_external_scanner_state_eq.

    length_add

    fn length_add(len1 : Length, len2 : Length) -> Length

    length_is_undefined

    fn length_is_undefined(length : Length) -> Bool

    length_max

    let length_max : Length

    length_min

    fn length_min(len1 : Length, len2 : Length) -> Length

    length_saturating_sub

    fn length_saturating_sub(len1 : Length, len2 : Length) -> Length

    length_sub

    fn length_sub(len1 : Length, len2 : Length) -> Length

    length_undefined

    let length_undefined : Length

    length_zero

    fn length_zero() -> Length

    min_compatible_language_version

    let min_compatible_language_version : Int

    point_add

    fn point_add(a : Point, b : Point) -> Point

    point_edit

    fn point_edit(point : Point, byte : UInt, edit : InputEdit) -> (Point, UInt)

    ts_point_edit.

    point_eq

    fn point_eq(a : Point, b : Point) -> Bool

    point_gt

    fn point_gt(a : Point, b : Point) -> Bool

    point_gte

    fn point_gte(a : Point, b : Point) -> Bool

    point_lt

    fn point_lt(a : Point, b : Point) -> Bool

    point_lte

    fn point_lte(a : Point, b : Point) -> Bool

    point_max

    let point_max : Point

    point_sub

    fn point_sub(a : Point, b : Point) -> Point

    point_zero

    let point_zero : Point

    range_array_get_changed_ranges

    fn range_array_get_changed_ranges(old_ranges : Array[Range], new_ranges : Array[Range], differences : Array[Range]) -> Unit

    ts_range_array_get_changed_ranges.

    range_array_intersects

    fn range_array_intersects(ranges : Array[Range], start_index : Int, start_byte : UInt, end_byte : UInt) -> Bool

    ts_range_array_intersects.

    run_lex_program

    fn run_lex_program(program :
    LexProgram
    , lexer : Lexer, start_state : Int) -> Bool

    Run a generated lex function (ts_lex/ts_lex_keywords) starting at state, exactly as the emitted C would.

    stack_version_none

    let stack_version_none : Int

    subtree_array_clear

    fn subtree_array_clear(array : Array[Subtree]) -> Unit

    ts_subtree_array_clear.

    subtree_array_copy

    fn subtree_array_copy(array : Array[Subtree]) -> Array[Subtree]

    ts_subtree_array_copy.

    subtree_array_delete

    fn subtree_array_delete(array : Array[Subtree]) -> Unit

    ts_subtree_array_delete.

    subtree_array_remove_trailing_extras

    fn subtree_array_remove_trailing_extras(array : Array[Subtree], destination : Array[Subtree]) -> Unit

    ts_subtree_array_remove_trailing_extras.

    subtree_array_reverse

    fn subtree_array_reverse(array : Array[Subtree]) -> Unit

    ts_subtree_array_reverse.

    subtree_get_changed_ranges

    fn subtree_get_changed_ranges(old_tree : SubtreeSlot, new_tree : SubtreeSlot, language :
    Language
    , included_range_differences : Array[Range]) -> Array[Range]

    ts_subtree_get_changed_ranges.

    ts_decode_error

    let ts_decode_error : Int

    write_symbol_as_dot_string

    fn write_symbol_as_dot_string(language :
    Language
    , f :
    Buffer
    , symbol : Int) -> Unit

    ts_language_write_symbol_as_dot_string.