ts

package
v0.0.0-...-7e94837 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ts provides low-level Go bindings for the tree-sitter C API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close unloads the library and clears all bound function pointers.

The function pointers are package-level state, so Close must not be called concurrently with any other call into this package: doing so is a use-after-free. It is intended for test teardown, not for reclaiming a live library.

func Has

func Has(symbol string) bool

Has reports whether the named C symbol resolved in the loaded library, loading it first if necessary. It returns false if the library failed to load. Use it to gate on capabilities before calling into them.

func HasLanguageAbiVersion

func HasLanguageAbiVersion() bool

HasLanguageAbiVersion reports whether ts_language_abi_version resolved in the loaded library.

func HasLanguageCopy

func HasLanguageCopy() bool

HasLanguageCopy reports whether ts_language_copy resolved in the loaded library.

func HasLanguageDelete

func HasLanguageDelete() bool

HasLanguageDelete reports whether ts_language_delete resolved in the loaded library.

func HasLanguageFieldCount

func HasLanguageFieldCount() bool

HasLanguageFieldCount reports whether ts_language_field_count resolved in the loaded library.

func HasLanguageFieldIdForName

func HasLanguageFieldIdForName() bool

HasLanguageFieldIdForName reports whether ts_language_field_id_for_name resolved in the loaded library.

func HasLanguageFieldNameForId

func HasLanguageFieldNameForId() bool

HasLanguageFieldNameForId reports whether ts_language_field_name_for_id resolved in the loaded library.

func HasLanguageMetadata

func HasLanguageMetadata() bool

HasLanguageMetadata reports whether ts_language_metadata resolved in the loaded library.

func HasLanguageName

func HasLanguageName() bool

HasLanguageName reports whether ts_language_name resolved in the loaded library.

func HasLanguageNextState

func HasLanguageNextState() bool

HasLanguageNextState reports whether ts_language_next_state resolved in the loaded library.

func HasLanguageStateCount

func HasLanguageStateCount() bool

HasLanguageStateCount reports whether ts_language_state_count resolved in the loaded library.

func HasLanguageSubtypes

func HasLanguageSubtypes() bool

HasLanguageSubtypes reports whether ts_language_subtypes resolved in the loaded library.

func HasLanguageSupertypes

func HasLanguageSupertypes() bool

HasLanguageSupertypes reports whether ts_language_supertypes resolved in the loaded library.

func HasLanguageSymbolCount

func HasLanguageSymbolCount() bool

HasLanguageSymbolCount reports whether ts_language_symbol_count resolved in the loaded library.

func HasLanguageSymbolForName

func HasLanguageSymbolForName() bool

HasLanguageSymbolForName reports whether ts_language_symbol_for_name resolved in the loaded library.

func HasLanguageSymbolName

func HasLanguageSymbolName() bool

HasLanguageSymbolName reports whether ts_language_symbol_name resolved in the loaded library.

func HasLanguageSymbolType

func HasLanguageSymbolType() bool

HasLanguageSymbolType reports whether ts_language_symbol_type resolved in the loaded library.

func HasLookaheadIteratorCurrentSymbol

func HasLookaheadIteratorCurrentSymbol() bool

HasLookaheadIteratorCurrentSymbol reports whether ts_lookahead_iterator_current_symbol resolved in the loaded library.

func HasLookaheadIteratorCurrentSymbolName

func HasLookaheadIteratorCurrentSymbolName() bool

HasLookaheadIteratorCurrentSymbolName reports whether ts_lookahead_iterator_current_symbol_name resolved in the loaded library.

func HasLookaheadIteratorDelete

func HasLookaheadIteratorDelete() bool

HasLookaheadIteratorDelete reports whether ts_lookahead_iterator_delete resolved in the loaded library.

func HasLookaheadIteratorLanguage

func HasLookaheadIteratorLanguage() bool

HasLookaheadIteratorLanguage reports whether ts_lookahead_iterator_language resolved in the loaded library.

func HasLookaheadIteratorNew

func HasLookaheadIteratorNew() bool

HasLookaheadIteratorNew reports whether ts_lookahead_iterator_new resolved in the loaded library.

func HasLookaheadIteratorNext

func HasLookaheadIteratorNext() bool

HasLookaheadIteratorNext reports whether ts_lookahead_iterator_next resolved in the loaded library.

func HasLookaheadIteratorReset

func HasLookaheadIteratorReset() bool

HasLookaheadIteratorReset reports whether ts_lookahead_iterator_reset resolved in the loaded library.

func HasLookaheadIteratorResetState

func HasLookaheadIteratorResetState() bool

HasLookaheadIteratorResetState reports whether ts_lookahead_iterator_reset_state resolved in the loaded library.

func HasNodeChild

func HasNodeChild() bool

HasNodeChild reports whether ts_node_child resolved in the loaded library.

func HasNodeChildByFieldId

func HasNodeChildByFieldId() bool

HasNodeChildByFieldId reports whether ts_node_child_by_field_id resolved in the loaded library.

func HasNodeChildByFieldName

func HasNodeChildByFieldName() bool

HasNodeChildByFieldName reports whether ts_node_child_by_field_name resolved in the loaded library.

func HasNodeChildCount

func HasNodeChildCount() bool

HasNodeChildCount reports whether ts_node_child_count resolved in the loaded library.

func HasNodeChildWithDescendant

func HasNodeChildWithDescendant() bool

HasNodeChildWithDescendant reports whether ts_node_child_with_descendant resolved in the loaded library.

func HasNodeDescendantCount

func HasNodeDescendantCount() bool

HasNodeDescendantCount reports whether ts_node_descendant_count resolved in the loaded library.

func HasNodeDescendantForByteRange

func HasNodeDescendantForByteRange() bool

HasNodeDescendantForByteRange reports whether ts_node_descendant_for_byte_range resolved in the loaded library.

func HasNodeDescendantForPointRange

func HasNodeDescendantForPointRange() bool

HasNodeDescendantForPointRange reports whether ts_node_descendant_for_point_range resolved in the loaded library.

func HasNodeEdit

func HasNodeEdit() bool

HasNodeEdit reports whether ts_node_edit resolved in the loaded library.

func HasNodeEndByte

func HasNodeEndByte() bool

HasNodeEndByte reports whether ts_node_end_byte resolved in the loaded library.

func HasNodeEndPoint

func HasNodeEndPoint() bool

HasNodeEndPoint reports whether ts_node_end_point resolved in the loaded library.

func HasNodeEq

func HasNodeEq() bool

HasNodeEq reports whether ts_node_eq resolved in the loaded library.

func HasNodeFieldNameForChild

func HasNodeFieldNameForChild() bool

HasNodeFieldNameForChild reports whether ts_node_field_name_for_child resolved in the loaded library.

func HasNodeFieldNameForNamedChild

func HasNodeFieldNameForNamedChild() bool

HasNodeFieldNameForNamedChild reports whether ts_node_field_name_for_named_child resolved in the loaded library.

func HasNodeFirstChildForByte

func HasNodeFirstChildForByte() bool

HasNodeFirstChildForByte reports whether ts_node_first_child_for_byte resolved in the loaded library.

func HasNodeFirstNamedChildForByte

func HasNodeFirstNamedChildForByte() bool

HasNodeFirstNamedChildForByte reports whether ts_node_first_named_child_for_byte resolved in the loaded library.

func HasNodeGrammarSymbol

func HasNodeGrammarSymbol() bool

HasNodeGrammarSymbol reports whether ts_node_grammar_symbol resolved in the loaded library.

func HasNodeGrammarType

func HasNodeGrammarType() bool

HasNodeGrammarType reports whether ts_node_grammar_type resolved in the loaded library.

func HasNodeHasChanges

func HasNodeHasChanges() bool

HasNodeHasChanges reports whether ts_node_has_changes resolved in the loaded library.

func HasNodeHasError

func HasNodeHasError() bool

HasNodeHasError reports whether ts_node_has_error resolved in the loaded library.

func HasNodeIsError

func HasNodeIsError() bool

HasNodeIsError reports whether ts_node_is_error resolved in the loaded library.

func HasNodeIsExtra

func HasNodeIsExtra() bool

HasNodeIsExtra reports whether ts_node_is_extra resolved in the loaded library.

func HasNodeIsMissing

func HasNodeIsMissing() bool

HasNodeIsMissing reports whether ts_node_is_missing resolved in the loaded library.

func HasNodeIsNamed

func HasNodeIsNamed() bool

HasNodeIsNamed reports whether ts_node_is_named resolved in the loaded library.

func HasNodeIsNull

func HasNodeIsNull() bool

HasNodeIsNull reports whether ts_node_is_null resolved in the loaded library.

func HasNodeLanguage

func HasNodeLanguage() bool

HasNodeLanguage reports whether ts_node_language resolved in the loaded library.

func HasNodeNamedChild

func HasNodeNamedChild() bool

HasNodeNamedChild reports whether ts_node_named_child resolved in the loaded library.

func HasNodeNamedChildCount

func HasNodeNamedChildCount() bool

HasNodeNamedChildCount reports whether ts_node_named_child_count resolved in the loaded library.

func HasNodeNamedDescendantForByteRange

func HasNodeNamedDescendantForByteRange() bool

HasNodeNamedDescendantForByteRange reports whether ts_node_named_descendant_for_byte_range resolved in the loaded library.

func HasNodeNamedDescendantForPointRange

func HasNodeNamedDescendantForPointRange() bool

HasNodeNamedDescendantForPointRange reports whether ts_node_named_descendant_for_point_range resolved in the loaded library.

func HasNodeNextNamedSibling

func HasNodeNextNamedSibling() bool

HasNodeNextNamedSibling reports whether ts_node_next_named_sibling resolved in the loaded library.

func HasNodeNextParseState

func HasNodeNextParseState() bool

HasNodeNextParseState reports whether ts_node_next_parse_state resolved in the loaded library.

func HasNodeNextSibling

func HasNodeNextSibling() bool

HasNodeNextSibling reports whether ts_node_next_sibling resolved in the loaded library.

func HasNodeParent

func HasNodeParent() bool

HasNodeParent reports whether ts_node_parent resolved in the loaded library.

func HasNodeParseState

func HasNodeParseState() bool

HasNodeParseState reports whether ts_node_parse_state resolved in the loaded library.

func HasNodePrevNamedSibling

func HasNodePrevNamedSibling() bool

HasNodePrevNamedSibling reports whether ts_node_prev_named_sibling resolved in the loaded library.

func HasNodePrevSibling

func HasNodePrevSibling() bool

HasNodePrevSibling reports whether ts_node_prev_sibling resolved in the loaded library.

func HasNodeStartByte

func HasNodeStartByte() bool

HasNodeStartByte reports whether ts_node_start_byte resolved in the loaded library.

func HasNodeStartPoint

func HasNodeStartPoint() bool

HasNodeStartPoint reports whether ts_node_start_point resolved in the loaded library.

func HasNodeString

func HasNodeString() bool

HasNodeString reports whether ts_node_string resolved in the loaded library.

func HasNodeSymbol

func HasNodeSymbol() bool

HasNodeSymbol reports whether ts_node_symbol resolved in the loaded library.

func HasNodeType

func HasNodeType() bool

HasNodeType reports whether ts_node_type resolved in the loaded library.

func HasParserDelete

func HasParserDelete() bool

HasParserDelete reports whether ts_parser_delete resolved in the loaded library.

func HasParserIncludedRanges

func HasParserIncludedRanges() bool

HasParserIncludedRanges reports whether ts_parser_included_ranges resolved in the loaded library.

func HasParserLanguage

func HasParserLanguage() bool

HasParserLanguage reports whether ts_parser_language resolved in the loaded library.

func HasParserLogger

func HasParserLogger() bool

HasParserLogger reports whether ts_parser_logger resolved in the loaded library.

func HasParserNew

func HasParserNew() bool

HasParserNew reports whether ts_parser_new resolved in the loaded library.

func HasParserParse

func HasParserParse() bool

HasParserParse reports whether ts_parser_parse resolved in the loaded library.

func HasParserParseString

func HasParserParseString() bool

HasParserParseString reports whether ts_parser_parse_string resolved in the loaded library.

func HasParserParseStringEncoding

func HasParserParseStringEncoding() bool

HasParserParseStringEncoding reports whether ts_parser_parse_string_encoding resolved in the loaded library.

func HasParserParseWithOptions

func HasParserParseWithOptions() bool

HasParserParseWithOptions reports whether ts_parser_parse_with_options resolved in the loaded library.

func HasParserPrintDotGraphs

func HasParserPrintDotGraphs() bool

HasParserPrintDotGraphs reports whether ts_parser_print_dot_graphs resolved in the loaded library.

func HasParserReset

func HasParserReset() bool

HasParserReset reports whether ts_parser_reset resolved in the loaded library.

func HasParserSetIncludedRanges

func HasParserSetIncludedRanges() bool

HasParserSetIncludedRanges reports whether ts_parser_set_included_ranges resolved in the loaded library.

func HasParserSetLanguage

func HasParserSetLanguage() bool

HasParserSetLanguage reports whether ts_parser_set_language resolved in the loaded library.

func HasParserSetLogger

func HasParserSetLogger() bool

HasParserSetLogger reports whether ts_parser_set_logger resolved in the loaded library.

func HasPointEdit

func HasPointEdit() bool

HasPointEdit reports whether ts_point_edit resolved in the loaded library.

func HasQueryCaptureCount

func HasQueryCaptureCount() bool

HasQueryCaptureCount reports whether ts_query_capture_count resolved in the loaded library.

func HasQueryCaptureNameForId

func HasQueryCaptureNameForId() bool

HasQueryCaptureNameForId reports whether ts_query_capture_name_for_id resolved in the loaded library.

func HasQueryCaptureQuantifierForId

func HasQueryCaptureQuantifierForId() bool

HasQueryCaptureQuantifierForId reports whether ts_query_capture_quantifier_for_id resolved in the loaded library.

func HasQueryCursorDelete

func HasQueryCursorDelete() bool

HasQueryCursorDelete reports whether ts_query_cursor_delete resolved in the loaded library.

func HasQueryCursorDidExceedMatchLimit

func HasQueryCursorDidExceedMatchLimit() bool

HasQueryCursorDidExceedMatchLimit reports whether ts_query_cursor_did_exceed_match_limit resolved in the loaded library.

func HasQueryCursorExec

func HasQueryCursorExec() bool

HasQueryCursorExec reports whether ts_query_cursor_exec resolved in the loaded library.

func HasQueryCursorExecWithOptions

func HasQueryCursorExecWithOptions() bool

HasQueryCursorExecWithOptions reports whether ts_query_cursor_exec_with_options resolved in the loaded library.

func HasQueryCursorMatchLimit

func HasQueryCursorMatchLimit() bool

HasQueryCursorMatchLimit reports whether ts_query_cursor_match_limit resolved in the loaded library.

func HasQueryCursorNew

func HasQueryCursorNew() bool

HasQueryCursorNew reports whether ts_query_cursor_new resolved in the loaded library.

func HasQueryCursorNextCapture

func HasQueryCursorNextCapture() bool

HasQueryCursorNextCapture reports whether ts_query_cursor_next_capture resolved in the loaded library.

func HasQueryCursorNextMatch

func HasQueryCursorNextMatch() bool

HasQueryCursorNextMatch reports whether ts_query_cursor_next_match resolved in the loaded library.

func HasQueryCursorRemoveMatch

func HasQueryCursorRemoveMatch() bool

HasQueryCursorRemoveMatch reports whether ts_query_cursor_remove_match resolved in the loaded library.

func HasQueryCursorSetByteRange

func HasQueryCursorSetByteRange() bool

HasQueryCursorSetByteRange reports whether ts_query_cursor_set_byte_range resolved in the loaded library.

func HasQueryCursorSetContainingByteRange

func HasQueryCursorSetContainingByteRange() bool

HasQueryCursorSetContainingByteRange reports whether ts_query_cursor_set_containing_byte_range resolved in the loaded library.

func HasQueryCursorSetContainingPointRange

func HasQueryCursorSetContainingPointRange() bool

HasQueryCursorSetContainingPointRange reports whether ts_query_cursor_set_containing_point_range resolved in the loaded library.

func HasQueryCursorSetMatchLimit

func HasQueryCursorSetMatchLimit() bool

HasQueryCursorSetMatchLimit reports whether ts_query_cursor_set_match_limit resolved in the loaded library.

func HasQueryCursorSetMaxStartDepth

func HasQueryCursorSetMaxStartDepth() bool

HasQueryCursorSetMaxStartDepth reports whether ts_query_cursor_set_max_start_depth resolved in the loaded library.

func HasQueryCursorSetPointRange

func HasQueryCursorSetPointRange() bool

HasQueryCursorSetPointRange reports whether ts_query_cursor_set_point_range resolved in the loaded library.

func HasQueryDelete

func HasQueryDelete() bool

HasQueryDelete reports whether ts_query_delete resolved in the loaded library.

func HasQueryDisableCapture

func HasQueryDisableCapture() bool

HasQueryDisableCapture reports whether ts_query_disable_capture resolved in the loaded library.

func HasQueryDisablePattern

func HasQueryDisablePattern() bool

HasQueryDisablePattern reports whether ts_query_disable_pattern resolved in the loaded library.

func HasQueryEndByteForPattern

func HasQueryEndByteForPattern() bool

HasQueryEndByteForPattern reports whether ts_query_end_byte_for_pattern resolved in the loaded library.

func HasQueryIsPatternGuaranteedAtStep

func HasQueryIsPatternGuaranteedAtStep() bool

HasQueryIsPatternGuaranteedAtStep reports whether ts_query_is_pattern_guaranteed_at_step resolved in the loaded library.

func HasQueryIsPatternNonLocal

func HasQueryIsPatternNonLocal() bool

HasQueryIsPatternNonLocal reports whether ts_query_is_pattern_non_local resolved in the loaded library.

func HasQueryIsPatternRooted

func HasQueryIsPatternRooted() bool

HasQueryIsPatternRooted reports whether ts_query_is_pattern_rooted resolved in the loaded library.

func HasQueryNew

func HasQueryNew() bool

HasQueryNew reports whether ts_query_new resolved in the loaded library.

func HasQueryPatternCount

func HasQueryPatternCount() bool

HasQueryPatternCount reports whether ts_query_pattern_count resolved in the loaded library.

func HasQueryPredicatesForPattern

func HasQueryPredicatesForPattern() bool

HasQueryPredicatesForPattern reports whether ts_query_predicates_for_pattern resolved in the loaded library.

func HasQueryStartByteForPattern

func HasQueryStartByteForPattern() bool

HasQueryStartByteForPattern reports whether ts_query_start_byte_for_pattern resolved in the loaded library.

func HasQueryStringCount

func HasQueryStringCount() bool

HasQueryStringCount reports whether ts_query_string_count resolved in the loaded library.

func HasQueryStringValueForId

func HasQueryStringValueForId() bool

HasQueryStringValueForId reports whether ts_query_string_value_for_id resolved in the loaded library.

func HasRangeEdit

func HasRangeEdit() bool

HasRangeEdit reports whether ts_range_edit resolved in the loaded library.

func HasTreeCopy

func HasTreeCopy() bool

HasTreeCopy reports whether ts_tree_copy resolved in the loaded library.

func HasTreeCursorCopy

func HasTreeCursorCopy() bool

HasTreeCursorCopy reports whether ts_tree_cursor_copy resolved in the loaded library.

func HasTreeCursorCurrentDepth

func HasTreeCursorCurrentDepth() bool

HasTreeCursorCurrentDepth reports whether ts_tree_cursor_current_depth resolved in the loaded library.

func HasTreeCursorCurrentDescendantIndex

func HasTreeCursorCurrentDescendantIndex() bool

HasTreeCursorCurrentDescendantIndex reports whether ts_tree_cursor_current_descendant_index resolved in the loaded library.

func HasTreeCursorCurrentFieldId

func HasTreeCursorCurrentFieldId() bool

HasTreeCursorCurrentFieldId reports whether ts_tree_cursor_current_field_id resolved in the loaded library.

func HasTreeCursorCurrentFieldName

func HasTreeCursorCurrentFieldName() bool

HasTreeCursorCurrentFieldName reports whether ts_tree_cursor_current_field_name resolved in the loaded library.

func HasTreeCursorCurrentNode

func HasTreeCursorCurrentNode() bool

HasTreeCursorCurrentNode reports whether ts_tree_cursor_current_node resolved in the loaded library.

func HasTreeCursorDelete

func HasTreeCursorDelete() bool

HasTreeCursorDelete reports whether ts_tree_cursor_delete resolved in the loaded library.

func HasTreeCursorGotoDescendant

func HasTreeCursorGotoDescendant() bool

HasTreeCursorGotoDescendant reports whether ts_tree_cursor_goto_descendant resolved in the loaded library.

func HasTreeCursorGotoFirstChild

func HasTreeCursorGotoFirstChild() bool

HasTreeCursorGotoFirstChild reports whether ts_tree_cursor_goto_first_child resolved in the loaded library.

func HasTreeCursorGotoFirstChildForByte

func HasTreeCursorGotoFirstChildForByte() bool

HasTreeCursorGotoFirstChildForByte reports whether ts_tree_cursor_goto_first_child_for_byte resolved in the loaded library.

func HasTreeCursorGotoFirstChildForPoint

func HasTreeCursorGotoFirstChildForPoint() bool

HasTreeCursorGotoFirstChildForPoint reports whether ts_tree_cursor_goto_first_child_for_point resolved in the loaded library.

func HasTreeCursorGotoLastChild

func HasTreeCursorGotoLastChild() bool

HasTreeCursorGotoLastChild reports whether ts_tree_cursor_goto_last_child resolved in the loaded library.

func HasTreeCursorGotoNextSibling

func HasTreeCursorGotoNextSibling() bool

HasTreeCursorGotoNextSibling reports whether ts_tree_cursor_goto_next_sibling resolved in the loaded library.

func HasTreeCursorGotoParent

func HasTreeCursorGotoParent() bool

HasTreeCursorGotoParent reports whether ts_tree_cursor_goto_parent resolved in the loaded library.

func HasTreeCursorGotoPreviousSibling

func HasTreeCursorGotoPreviousSibling() bool

HasTreeCursorGotoPreviousSibling reports whether ts_tree_cursor_goto_previous_sibling resolved in the loaded library.

func HasTreeCursorNew

func HasTreeCursorNew() bool

HasTreeCursorNew reports whether ts_tree_cursor_new resolved in the loaded library.

func HasTreeCursorReset

func HasTreeCursorReset() bool

HasTreeCursorReset reports whether ts_tree_cursor_reset resolved in the loaded library.

func HasTreeCursorResetTo

func HasTreeCursorResetTo() bool

HasTreeCursorResetTo reports whether ts_tree_cursor_reset_to resolved in the loaded library.

func HasTreeDelete

func HasTreeDelete() bool

HasTreeDelete reports whether ts_tree_delete resolved in the loaded library.

func HasTreeEdit

func HasTreeEdit() bool

HasTreeEdit reports whether ts_tree_edit resolved in the loaded library.

func HasTreeGetChangedRanges

func HasTreeGetChangedRanges() bool

HasTreeGetChangedRanges reports whether ts_tree_get_changed_ranges resolved in the loaded library.

func HasTreeIncludedRanges

func HasTreeIncludedRanges() bool

HasTreeIncludedRanges reports whether ts_tree_included_ranges resolved in the loaded library.

func HasTreeLanguage

func HasTreeLanguage() bool

HasTreeLanguage reports whether ts_tree_language resolved in the loaded library.

func HasTreePrintDotGraph

func HasTreePrintDotGraph() bool

HasTreePrintDotGraph reports whether ts_tree_print_dot_graph resolved in the loaded library.

func HasTreeRootNode

func HasTreeRootNode() bool

HasTreeRootNode reports whether ts_tree_root_node resolved in the loaded library.

func HasTreeRootNodeWithOffset

func HasTreeRootNodeWithOffset() bool

HasTreeRootNodeWithOffset reports whether ts_tree_root_node_with_offset resolved in the loaded library.

func LanguageAbiVersion

func LanguageAbiVersion(self Language) uint32

LanguageAbiVersion wraps ts_language_abi_version. It panics if the library cannot be loaded or lacks the symbol.

func LanguageCopy

func LanguageCopy(self Language) uintptr

LanguageCopy wraps ts_language_copy. It panics if the library cannot be loaded or lacks the symbol.

func LanguageDelete

func LanguageDelete(self Language)

LanguageDelete wraps ts_language_delete. It panics if the library cannot be loaded or lacks the symbol.

func LanguageFieldCount

func LanguageFieldCount(self Language) uint32

LanguageFieldCount wraps ts_language_field_count. It panics if the library cannot be loaded or lacks the symbol.

func LanguageFieldNameForId

func LanguageFieldNameForId(self Language, id FieldId) string

LanguageFieldNameForId wraps ts_language_field_name_for_id. It panics if the library cannot be loaded or lacks the symbol.

func LanguageMetadata

func LanguageMetadata(self Language) uintptr

LanguageMetadata wraps ts_language_metadata. It panics if the library cannot be loaded or lacks the symbol.

func LanguageName

func LanguageName(self Language) string

LanguageName wraps ts_language_name. It panics if the library cannot be loaded or lacks the symbol.

func LanguageStateCount

func LanguageStateCount(self Language) uint32

LanguageStateCount wraps ts_language_state_count. It panics if the library cannot be loaded or lacks the symbol.

func LanguageSubtypes

func LanguageSubtypes(self Language, supertype Symbol, length *uint32) uintptr

LanguageSubtypes wraps ts_language_subtypes. It panics if the library cannot be loaded or lacks the symbol.

func LanguageSupertypes

func LanguageSupertypes(self Language, length *uint32) uintptr

LanguageSupertypes wraps ts_language_supertypes. It panics if the library cannot be loaded or lacks the symbol.

func LanguageSymbolCount

func LanguageSymbolCount(self Language) uint32

LanguageSymbolCount wraps ts_language_symbol_count. It panics if the library cannot be loaded or lacks the symbol.

func LanguageSymbolName

func LanguageSymbolName(self Language, symbol Symbol) string

LanguageSymbolName wraps ts_language_symbol_name. It panics if the library cannot be loaded or lacks the symbol.

func Load

func Load(path string) error

Load opens the shared library from path, or from the default search list when path is empty, and binds all symbols. Callers that need to direct loading should call Load before any other function; otherwise the first call loads from the default search list.

Load is idempotent: calling it again with the same path, or with an empty path, returns nil. Calling it with a different path after a successful load returns *LibraryConflictError rather than replacing the library. After a failed load, Load retries.

func Loaded

func Loaded() bool

Loaded reports whether the library is currently loaded. It does not trigger a load.

func LookaheadIteratorCurrentSymbolName

func LookaheadIteratorCurrentSymbolName(self LookaheadIterator) string

LookaheadIteratorCurrentSymbolName wraps ts_lookahead_iterator_current_symbol_name. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorDelete

func LookaheadIteratorDelete(self LookaheadIterator)

LookaheadIteratorDelete wraps ts_lookahead_iterator_delete. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorLanguage

func LookaheadIteratorLanguage(self LookaheadIterator) uintptr

LookaheadIteratorLanguage wraps ts_lookahead_iterator_language. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorNew

func LookaheadIteratorNew(self Language, state StateId) uintptr

LookaheadIteratorNew wraps ts_lookahead_iterator_new. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorNext

func LookaheadIteratorNext(self LookaheadIterator) bool

LookaheadIteratorNext wraps ts_lookahead_iterator_next. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorReset

func LookaheadIteratorReset(self LookaheadIterator, language Language, state StateId) bool

LookaheadIteratorReset wraps ts_lookahead_iterator_reset. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorResetState

func LookaheadIteratorResetState(self LookaheadIterator, state StateId) bool

LookaheadIteratorResetState wraps ts_lookahead_iterator_reset_state. It panics if the library cannot be loaded or lacks the symbol.

func NodeChildCount

func NodeChildCount(self Node) uint32

NodeChildCount wraps ts_node_child_count. It panics if the library cannot be loaded or lacks the symbol.

func NodeDescendantCount

func NodeDescendantCount(self Node) uint32

NodeDescendantCount wraps ts_node_descendant_count. It panics if the library cannot be loaded or lacks the symbol.

func NodeEdit

func NodeEdit(self *Node, edit *InputEdit)

NodeEdit wraps ts_node_edit. It panics if the library cannot be loaded or lacks the symbol.

func NodeEndByte

func NodeEndByte(self Node) uint32

NodeEndByte wraps ts_node_end_byte. It panics if the library cannot be loaded or lacks the symbol.

func NodeEq

func NodeEq(self Node, other Node) bool

NodeEq wraps ts_node_eq. It panics if the library cannot be loaded or lacks the symbol.

func NodeFieldNameForChild

func NodeFieldNameForChild(self Node, childIndex uint32) string

NodeFieldNameForChild wraps ts_node_field_name_for_child. It panics if the library cannot be loaded or lacks the symbol.

func NodeFieldNameForNamedChild

func NodeFieldNameForNamedChild(self Node, namedChildIndex uint32) string

NodeFieldNameForNamedChild wraps ts_node_field_name_for_named_child. It panics if the library cannot be loaded or lacks the symbol.

func NodeGrammarType

func NodeGrammarType(self Node) string

NodeGrammarType wraps ts_node_grammar_type. It panics if the library cannot be loaded or lacks the symbol.

func NodeHasChanges

func NodeHasChanges(self Node) bool

NodeHasChanges wraps ts_node_has_changes. It panics if the library cannot be loaded or lacks the symbol.

func NodeHasError

func NodeHasError(self Node) bool

NodeHasError wraps ts_node_has_error. It panics if the library cannot be loaded or lacks the symbol.

func NodeIsError

func NodeIsError(self Node) bool

NodeIsError wraps ts_node_is_error. It panics if the library cannot be loaded or lacks the symbol.

func NodeIsExtra

func NodeIsExtra(self Node) bool

NodeIsExtra wraps ts_node_is_extra. It panics if the library cannot be loaded or lacks the symbol.

func NodeIsMissing

func NodeIsMissing(self Node) bool

NodeIsMissing wraps ts_node_is_missing. It panics if the library cannot be loaded or lacks the symbol.

func NodeIsNamed

func NodeIsNamed(self Node) bool

NodeIsNamed wraps ts_node_is_named. It panics if the library cannot be loaded or lacks the symbol.

func NodeIsNull

func NodeIsNull(self Node) bool

NodeIsNull wraps ts_node_is_null. It panics if the library cannot be loaded or lacks the symbol.

func NodeLanguage

func NodeLanguage(self Node) uintptr

NodeLanguage wraps ts_node_language. It panics if the library cannot be loaded or lacks the symbol.

func NodeNamedChildCount

func NodeNamedChildCount(self Node) uint32

NodeNamedChildCount wraps ts_node_named_child_count. It panics if the library cannot be loaded or lacks the symbol.

func NodeStartByte

func NodeStartByte(self Node) uint32

NodeStartByte wraps ts_node_start_byte. It panics if the library cannot be loaded or lacks the symbol.

func NodeString

func NodeString(self Node) uintptr

NodeString wraps ts_node_string. It panics if the library cannot be loaded or lacks the symbol.

func NodeType

func NodeType(self Node) string

NodeType wraps ts_node_type. It panics if the library cannot be loaded or lacks the symbol.

func ParserDelete

func ParserDelete(self Parser)

ParserDelete wraps ts_parser_delete. It panics if the library cannot be loaded or lacks the symbol.

func ParserIncludedRanges

func ParserIncludedRanges(self Parser, count *uint32) uintptr

ParserIncludedRanges wraps ts_parser_included_ranges. It panics if the library cannot be loaded or lacks the symbol.

func ParserLanguage

func ParserLanguage(self Parser) uintptr

ParserLanguage wraps ts_parser_language. It panics if the library cannot be loaded or lacks the symbol.

func ParserNew

func ParserNew() uintptr

ParserNew wraps ts_parser_new. It panics if the library cannot be loaded or lacks the symbol.

func ParserParse

func ParserParse(self Parser, oldTree Tree, input Input) uintptr

ParserParse wraps ts_parser_parse. It panics if the library cannot be loaded or lacks the symbol.

func ParserParseString

func ParserParseString(self Parser, oldTree Tree, string_ *byte, length uint32) uintptr

ParserParseString wraps ts_parser_parse_string. It panics if the library cannot be loaded or lacks the symbol.

func ParserParseStringEncoding

func ParserParseStringEncoding(self Parser, oldTree Tree, string_ *byte, length uint32, encoding InputEncoding) uintptr

ParserParseStringEncoding wraps ts_parser_parse_string_encoding. It panics if the library cannot be loaded or lacks the symbol.

func ParserParseWithOptions

func ParserParseWithOptions(self Parser, oldTree Tree, input Input, parseOptions ParseOptions) uintptr

ParserParseWithOptions wraps ts_parser_parse_with_options. It panics if the library cannot be loaded or lacks the symbol.

func ParserPrintDotGraphs

func ParserPrintDotGraphs(self Parser, fd int32)

ParserPrintDotGraphs wraps ts_parser_print_dot_graphs. It panics if the library cannot be loaded or lacks the symbol.

func ParserReset

func ParserReset(self Parser)

ParserReset wraps ts_parser_reset. It panics if the library cannot be loaded or lacks the symbol.

func ParserSetIncludedRanges

func ParserSetIncludedRanges(self Parser, ranges *Range, count uint32) bool

ParserSetIncludedRanges wraps ts_parser_set_included_ranges. It panics if the library cannot be loaded or lacks the symbol.

func ParserSetLanguage

func ParserSetLanguage(self Parser, language Language) bool

ParserSetLanguage wraps ts_parser_set_language. It panics if the library cannot be loaded or lacks the symbol.

func ParserSetLogger

func ParserSetLogger(self Parser, logger Logger)

ParserSetLogger wraps ts_parser_set_logger. It panics if the library cannot be loaded or lacks the symbol.

func Path

func Path() string

Path returns the path or name the loaded library was opened from, or the empty string if no library is loaded.

func PointEdit

func PointEdit(point *Point, pointByte *uint32, edit *InputEdit)

PointEdit wraps ts_point_edit. It panics if the library cannot be loaded or lacks the symbol.

func QueryCaptureCount

func QueryCaptureCount(self Query) uint32

QueryCaptureCount wraps ts_query_capture_count. It panics if the library cannot be loaded or lacks the symbol.

func QueryCaptureNameForId

func QueryCaptureNameForId(self Query, index uint32, length *uint32) string

QueryCaptureNameForId wraps ts_query_capture_name_for_id. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorDelete

func QueryCursorDelete(self QueryCursor)

QueryCursorDelete wraps ts_query_cursor_delete. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorDidExceedMatchLimit

func QueryCursorDidExceedMatchLimit(self QueryCursor) bool

QueryCursorDidExceedMatchLimit wraps ts_query_cursor_did_exceed_match_limit. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorExec

func QueryCursorExec(self QueryCursor, query Query, node Node)

QueryCursorExec wraps ts_query_cursor_exec. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorExecWithOptions

func QueryCursorExecWithOptions(self QueryCursor, query Query, node Node, queryOptions *QueryCursorOptions)

QueryCursorExecWithOptions wraps ts_query_cursor_exec_with_options. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorMatchLimit

func QueryCursorMatchLimit(self QueryCursor) uint32

QueryCursorMatchLimit wraps ts_query_cursor_match_limit. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorNew

func QueryCursorNew() uintptr

QueryCursorNew wraps ts_query_cursor_new. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorNextCapture

func QueryCursorNextCapture(self QueryCursor, match *QueryMatch, captureIndex *uint32) bool

QueryCursorNextCapture wraps ts_query_cursor_next_capture. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorNextMatch

func QueryCursorNextMatch(self QueryCursor, match *QueryMatch) bool

QueryCursorNextMatch wraps ts_query_cursor_next_match. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorRemoveMatch

func QueryCursorRemoveMatch(self QueryCursor, matchId uint32)

QueryCursorRemoveMatch wraps ts_query_cursor_remove_match. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetByteRange

func QueryCursorSetByteRange(self QueryCursor, startByte uint32, endByte uint32) bool

QueryCursorSetByteRange wraps ts_query_cursor_set_byte_range. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetContainingByteRange

func QueryCursorSetContainingByteRange(self QueryCursor, startByte uint32, endByte uint32) bool

QueryCursorSetContainingByteRange wraps ts_query_cursor_set_containing_byte_range. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetContainingPointRange

func QueryCursorSetContainingPointRange(self QueryCursor, startPoint Point, endPoint Point) bool

QueryCursorSetContainingPointRange wraps ts_query_cursor_set_containing_point_range. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetMatchLimit

func QueryCursorSetMatchLimit(self QueryCursor, limit uint32)

QueryCursorSetMatchLimit wraps ts_query_cursor_set_match_limit. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetMaxStartDepth

func QueryCursorSetMaxStartDepth(self QueryCursor, maxStartDepth uint32)

QueryCursorSetMaxStartDepth wraps ts_query_cursor_set_max_start_depth. It panics if the library cannot be loaded or lacks the symbol.

func QueryCursorSetPointRange

func QueryCursorSetPointRange(self QueryCursor, startPoint Point, endPoint Point) bool

QueryCursorSetPointRange wraps ts_query_cursor_set_point_range. It panics if the library cannot be loaded or lacks the symbol.

func QueryDelete

func QueryDelete(self Query)

QueryDelete wraps ts_query_delete. It panics if the library cannot be loaded or lacks the symbol.

func QueryDisableCapture

func QueryDisableCapture(self Query, name *byte, length uint32)

QueryDisableCapture wraps ts_query_disable_capture. It panics if the library cannot be loaded or lacks the symbol.

func QueryDisablePattern

func QueryDisablePattern(self Query, patternIndex uint32)

QueryDisablePattern wraps ts_query_disable_pattern. It panics if the library cannot be loaded or lacks the symbol.

func QueryEndByteForPattern

func QueryEndByteForPattern(self Query, patternIndex uint32) uint32

QueryEndByteForPattern wraps ts_query_end_byte_for_pattern. It panics if the library cannot be loaded or lacks the symbol.

func QueryIsPatternGuaranteedAtStep

func QueryIsPatternGuaranteedAtStep(self Query, byteOffset uint32) bool

QueryIsPatternGuaranteedAtStep wraps ts_query_is_pattern_guaranteed_at_step. It panics if the library cannot be loaded or lacks the symbol.

func QueryIsPatternNonLocal

func QueryIsPatternNonLocal(self Query, patternIndex uint32) bool

QueryIsPatternNonLocal wraps ts_query_is_pattern_non_local. It panics if the library cannot be loaded or lacks the symbol.

func QueryIsPatternRooted

func QueryIsPatternRooted(self Query, patternIndex uint32) bool

QueryIsPatternRooted wraps ts_query_is_pattern_rooted. It panics if the library cannot be loaded or lacks the symbol.

func QueryNew

func QueryNew(language Language, source *byte, sourceLen uint32, errorOffset *uint32, errorType *QueryError) uintptr

QueryNew wraps ts_query_new. It panics if the library cannot be loaded or lacks the symbol.

func QueryPatternCount

func QueryPatternCount(self Query) uint32

QueryPatternCount wraps ts_query_pattern_count. It panics if the library cannot be loaded or lacks the symbol.

func QueryPredicatesForPattern

func QueryPredicatesForPattern(self Query, patternIndex uint32, stepCount *uint32) uintptr

QueryPredicatesForPattern wraps ts_query_predicates_for_pattern. It panics if the library cannot be loaded or lacks the symbol.

func QueryStartByteForPattern

func QueryStartByteForPattern(self Query, patternIndex uint32) uint32

QueryStartByteForPattern wraps ts_query_start_byte_for_pattern. It panics if the library cannot be loaded or lacks the symbol.

func QueryStringCount

func QueryStringCount(self Query) uint32

QueryStringCount wraps ts_query_string_count. It panics if the library cannot be loaded or lacks the symbol.

func QueryStringValueForId

func QueryStringValueForId(self Query, index uint32, length *uint32) string

QueryStringValueForId wraps ts_query_string_value_for_id. It panics if the library cannot be loaded or lacks the symbol.

func RangeEdit

func RangeEdit(range_ *Range, edit *InputEdit)

RangeEdit wraps ts_range_edit. It panics if the library cannot be loaded or lacks the symbol.

func TreeCopy

func TreeCopy(self Tree) uintptr

TreeCopy wraps ts_tree_copy. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorCurrentDepth

func TreeCursorCurrentDepth(self *TreeCursor) uint32

TreeCursorCurrentDepth wraps ts_tree_cursor_current_depth. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorCurrentDescendantIndex

func TreeCursorCurrentDescendantIndex(self *TreeCursor) uint32

TreeCursorCurrentDescendantIndex wraps ts_tree_cursor_current_descendant_index. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorCurrentFieldName

func TreeCursorCurrentFieldName(self *TreeCursor) string

TreeCursorCurrentFieldName wraps ts_tree_cursor_current_field_name. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorDelete

func TreeCursorDelete(self *TreeCursor)

TreeCursorDelete wraps ts_tree_cursor_delete. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoDescendant

func TreeCursorGotoDescendant(self *TreeCursor, goalDescendantIndex uint32)

TreeCursorGotoDescendant wraps ts_tree_cursor_goto_descendant. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoFirstChild

func TreeCursorGotoFirstChild(self *TreeCursor) bool

TreeCursorGotoFirstChild wraps ts_tree_cursor_goto_first_child. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoFirstChildForByte

func TreeCursorGotoFirstChildForByte(self *TreeCursor, goalByte uint32) int64

TreeCursorGotoFirstChildForByte wraps ts_tree_cursor_goto_first_child_for_byte. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoFirstChildForPoint

func TreeCursorGotoFirstChildForPoint(self *TreeCursor, goalPoint Point) int64

TreeCursorGotoFirstChildForPoint wraps ts_tree_cursor_goto_first_child_for_point. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoLastChild

func TreeCursorGotoLastChild(self *TreeCursor) bool

TreeCursorGotoLastChild wraps ts_tree_cursor_goto_last_child. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoNextSibling

func TreeCursorGotoNextSibling(self *TreeCursor) bool

TreeCursorGotoNextSibling wraps ts_tree_cursor_goto_next_sibling. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoParent

func TreeCursorGotoParent(self *TreeCursor) bool

TreeCursorGotoParent wraps ts_tree_cursor_goto_parent. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorGotoPreviousSibling

func TreeCursorGotoPreviousSibling(self *TreeCursor) bool

TreeCursorGotoPreviousSibling wraps ts_tree_cursor_goto_previous_sibling. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorReset

func TreeCursorReset(self *TreeCursor, node Node)

TreeCursorReset wraps ts_tree_cursor_reset. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorResetTo

func TreeCursorResetTo(dst *TreeCursor, src *TreeCursor)

TreeCursorResetTo wraps ts_tree_cursor_reset_to. It panics if the library cannot be loaded or lacks the symbol.

func TreeDelete

func TreeDelete(self Tree)

TreeDelete wraps ts_tree_delete. It panics if the library cannot be loaded or lacks the symbol.

func TreeEdit

func TreeEdit(self Tree, edit *InputEdit)

TreeEdit wraps ts_tree_edit. It panics if the library cannot be loaded or lacks the symbol.

func TreeGetChangedRanges

func TreeGetChangedRanges(oldTree Tree, newTree Tree, length *uint32) uintptr

TreeGetChangedRanges wraps ts_tree_get_changed_ranges. It panics if the library cannot be loaded or lacks the symbol.

func TreeIncludedRanges

func TreeIncludedRanges(self Tree, length *uint32) uintptr

TreeIncludedRanges wraps ts_tree_included_ranges. It panics if the library cannot be loaded or lacks the symbol.

func TreeLanguage

func TreeLanguage(self Tree) uintptr

TreeLanguage wraps ts_tree_language. It panics if the library cannot be loaded or lacks the symbol.

func TreePrintDotGraph

func TreePrintDotGraph(self Tree, fileDescriptor int32)

TreePrintDotGraph wraps ts_tree_print_dot_graph. It panics if the library cannot be loaded or lacks the symbol.

Types

type DecodeFunction

type DecodeFunction uintptr

DecodeFunction represents TSDecodeFunction.

type FieldId

type FieldId uint16

FieldId represents TSFieldId.

func LanguageFieldIdForName

func LanguageFieldIdForName(self Language, name *byte, nameLength uint32) FieldId

LanguageFieldIdForName wraps ts_language_field_id_for_name. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorCurrentFieldId

func TreeCursorCurrentFieldId(self *TreeCursor) FieldId

TreeCursorCurrentFieldId wraps ts_tree_cursor_current_field_id. It panics if the library cannot be loaded or lacks the symbol.

type Input

type Input struct {
	Payload  uintptr
	Read     uintptr
	Encoding InputEncoding
	Decode   DecodeFunction
}

Input represents TSInput.

type InputEdit

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

InputEdit represents A summary of a change to a text document..

type InputEncoding

type InputEncoding int32

InputEncoding represents TSInputEncoding.

const (
	InputEncodingUTF8    InputEncoding = 0
	InputEncodingUTF16LE InputEncoding = 1
	InputEncodingUTF16BE InputEncoding = 2
	InputEncodingCustom  InputEncoding = 3
)

func (InputEncoding) String

func (e InputEncoding) String() string

type Language

type Language uintptr

Language is an opaque handle-like type for struct TSLanguage.

type LanguageMetadataStruct

type LanguageMetadataStruct struct {
	MajorVersion uint8
	MinorVersion uint8
	PatchVersion uint8
}

LanguageMetadataStruct represents The metadata associated with a language..

type LibraryAttempt

type LibraryAttempt struct {
	Name string // path or soname passed to dlopen
	Err  error
}

LibraryAttempt records one failed attempt to open the shared library.

type LibraryConflictError

type LibraryConflictError struct {
	Loaded    string
	Requested string
}

LibraryConflictError reports a Load call naming a different library than the one already loaded. Only one library is loaded per process.

func (*LibraryConflictError) Error

func (e *LibraryConflictError) Error() string

type LibraryError

type LibraryError struct {
	Library  string
	Env      string
	Path     string
	Attempts []LibraryAttempt
	Hint     string
}

LibraryError reports that libtree-sitter could not be opened. Attempts lists every name tried in order. Path is set when an explicit path, from Load or TREE_SITTER_LIB_PATH, was requested and failed. Hint, when non-empty, says where pkg-config believes the library is installed.

func (*LibraryError) Error

func (e *LibraryError) Error() string

func (*LibraryError) Unwrap

func (e *LibraryError) Unwrap() []error

Unwrap returns the error from each attempt.

type LogType

type LogType int32

LogType represents TSLogType.

const (
	LogParse LogType = 0
	LogLex   LogType = 1
)

func (LogType) String

func (e LogType) String() string

type Logger

type Logger struct {
	Payload uintptr
	Log     uintptr
}

Logger represents TSLogger.

func ParserLogger

func ParserLogger(self Parser) Logger

ParserLogger wraps ts_parser_logger. It panics if the library cannot be loaded or lacks the symbol.

type LookaheadIterator

type LookaheadIterator uintptr

LookaheadIterator is an opaque handle-like type for struct TSLookaheadIterator.

type Node

type Node struct {
	Context [4]uint32
	Id      uintptr
	Tree    uintptr
}

Node represents TSNode.

func NodeChild

func NodeChild(self Node, childIndex uint32) Node

NodeChild wraps ts_node_child. It panics if the library cannot be loaded or lacks the symbol.

func NodeChildByFieldId

func NodeChildByFieldId(self Node, fieldId FieldId) Node

NodeChildByFieldId wraps ts_node_child_by_field_id. It panics if the library cannot be loaded or lacks the symbol.

func NodeChildByFieldName

func NodeChildByFieldName(self Node, name *byte, nameLength uint32) Node

NodeChildByFieldName wraps ts_node_child_by_field_name. It panics if the library cannot be loaded or lacks the symbol.

func NodeChildWithDescendant

func NodeChildWithDescendant(self Node, descendant Node) Node

NodeChildWithDescendant wraps ts_node_child_with_descendant. It panics if the library cannot be loaded or lacks the symbol.

func NodeDescendantForByteRange

func NodeDescendantForByteRange(self Node, start uint32, end uint32) Node

NodeDescendantForByteRange wraps ts_node_descendant_for_byte_range. It panics if the library cannot be loaded or lacks the symbol.

func NodeDescendantForPointRange

func NodeDescendantForPointRange(self Node, start Point, end Point) Node

NodeDescendantForPointRange wraps ts_node_descendant_for_point_range. It panics if the library cannot be loaded or lacks the symbol.

func NodeFirstChildForByte

func NodeFirstChildForByte(self Node, byte_ uint32) Node

NodeFirstChildForByte wraps ts_node_first_child_for_byte. It panics if the library cannot be loaded or lacks the symbol.

func NodeFirstNamedChildForByte

func NodeFirstNamedChildForByte(self Node, byte_ uint32) Node

NodeFirstNamedChildForByte wraps ts_node_first_named_child_for_byte. It panics if the library cannot be loaded or lacks the symbol.

func NodeNamedChild

func NodeNamedChild(self Node, childIndex uint32) Node

NodeNamedChild wraps ts_node_named_child. It panics if the library cannot be loaded or lacks the symbol.

func NodeNamedDescendantForByteRange

func NodeNamedDescendantForByteRange(self Node, start uint32, end uint32) Node

NodeNamedDescendantForByteRange wraps ts_node_named_descendant_for_byte_range. It panics if the library cannot be loaded or lacks the symbol.

func NodeNamedDescendantForPointRange

func NodeNamedDescendantForPointRange(self Node, start Point, end Point) Node

NodeNamedDescendantForPointRange wraps ts_node_named_descendant_for_point_range. It panics if the library cannot be loaded or lacks the symbol.

func NodeNextNamedSibling

func NodeNextNamedSibling(self Node) Node

NodeNextNamedSibling wraps ts_node_next_named_sibling. It panics if the library cannot be loaded or lacks the symbol.

func NodeNextSibling

func NodeNextSibling(self Node) Node

NodeNextSibling wraps ts_node_next_sibling. It panics if the library cannot be loaded or lacks the symbol.

func NodeParent

func NodeParent(self Node) Node

NodeParent wraps ts_node_parent. It panics if the library cannot be loaded or lacks the symbol.

func NodePrevNamedSibling

func NodePrevNamedSibling(self Node) Node

NodePrevNamedSibling wraps ts_node_prev_named_sibling. It panics if the library cannot be loaded or lacks the symbol.

func NodePrevSibling

func NodePrevSibling(self Node) Node

NodePrevSibling wraps ts_node_prev_sibling. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorCurrentNode

func TreeCursorCurrentNode(self *TreeCursor) Node

TreeCursorCurrentNode wraps ts_tree_cursor_current_node. It panics if the library cannot be loaded or lacks the symbol.

func TreeRootNode

func TreeRootNode(self Tree) Node

TreeRootNode wraps ts_tree_root_node. It panics if the library cannot be loaded or lacks the symbol.

func TreeRootNodeWithOffset

func TreeRootNodeWithOffset(self Tree, offsetBytes uint32, offsetExtent Point) Node

TreeRootNodeWithOffset wraps ts_tree_root_node_with_offset. It panics if the library cannot be loaded or lacks the symbol.

type ParseOptions

type ParseOptions struct {
	Payload          uintptr
	ProgressCallback uintptr
}

ParseOptions represents TSParseOptions.

type ParseState

type ParseState struct {
	Payload           uintptr
	CurrentByteOffset uint32
	HasError          bool
}

ParseState represents TSParseState.

type Parser

type Parser uintptr

Parser is an opaque handle-like type for struct TSParser.

type Point

type Point struct {
	Row    uint32
	Column uint32
}

Point represents TSPoint.

func NodeEndPoint

func NodeEndPoint(self Node) Point

NodeEndPoint wraps ts_node_end_point. It panics if the library cannot be loaded or lacks the symbol.

func NodeStartPoint

func NodeStartPoint(self Node) Point

NodeStartPoint wraps ts_node_start_point. It panics if the library cannot be loaded or lacks the symbol.

type Quantifier

type Quantifier int32

Quantifier represents TSQuantifier.

const (
	QuantifierZero       Quantifier = 0 // must match the array initialization value
	QuantifierZeroOrOne  Quantifier = 1
	QuantifierZeroOrMore Quantifier = 2
	QuantifierOne        Quantifier = 3
	QuantifierOneOrMore  Quantifier = 4
)

func QueryCaptureQuantifierForId

func QueryCaptureQuantifierForId(self Query, patternIndex uint32, captureIndex uint32) Quantifier

QueryCaptureQuantifierForId wraps ts_query_capture_quantifier_for_id. It panics if the library cannot be loaded or lacks the symbol.

func (Quantifier) String

func (e Quantifier) String() string

type Query

type Query uintptr

Query is an opaque handle-like type for struct TSQuery.

type QueryCapture

type QueryCapture struct {
	Node  Node
	Index uint32
}

QueryCapture represents TSQueryCapture.

type QueryCursor

type QueryCursor uintptr

QueryCursor is an opaque handle-like type for struct TSQueryCursor.

type QueryCursorOptions

type QueryCursorOptions struct {
	Payload          uintptr
	ProgressCallback uintptr
}

QueryCursorOptions represents TSQueryCursorOptions.

type QueryCursorState

type QueryCursorState struct {
	Payload           uintptr
	CurrentByteOffset uint32
}

QueryCursorState represents TSQueryCursorState.

type QueryError

type QueryError int32

QueryError represents TSQueryError.

const (
	QueryErrorNone      QueryError = 0
	QueryErrorSyntax    QueryError = 1
	QueryErrorNodeType  QueryError = 2
	QueryErrorField     QueryError = 3
	QueryErrorCapture   QueryError = 4
	QueryErrorStructure QueryError = 5
	QueryErrorLanguage  QueryError = 6
)

func (QueryError) String

func (e QueryError) String() string

type QueryMatch

type QueryMatch struct {
	Id           uint32
	PatternIndex uint16
	CaptureCount uint16
	Captures     uintptr
}

QueryMatch represents TSQueryMatch.

type QueryPredicateStep

type QueryPredicateStep struct {
	Type    QueryPredicateStepType
	ValueId uint32
}

QueryPredicateStep represents TSQueryPredicateStep.

type QueryPredicateStepType

type QueryPredicateStepType int32

QueryPredicateStepType represents TSQueryPredicateStepType.

const (
	QueryPredicateStepDone    QueryPredicateStepType = 0
	QueryPredicateStepCapture QueryPredicateStepType = 1
	QueryPredicateStepString  QueryPredicateStepType = 2
)

func (QueryPredicateStepType) String

func (e QueryPredicateStepType) String() string

type Range

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

Range represents TSRange.

type StateId

type StateId uint16

StateId represents TSStateId.

func LanguageNextState

func LanguageNextState(self Language, state StateId, symbol Symbol) StateId

LanguageNextState wraps ts_language_next_state. It panics if the library cannot be loaded or lacks the symbol.

func NodeNextParseState

func NodeNextParseState(self Node) StateId

NodeNextParseState wraps ts_node_next_parse_state. It panics if the library cannot be loaded or lacks the symbol.

func NodeParseState

func NodeParseState(self Node) StateId

NodeParseState wraps ts_node_parse_state. It panics if the library cannot be loaded or lacks the symbol.

type Symbol

type Symbol uint16

Symbol represents TSSymbol.

func LanguageSymbolForName

func LanguageSymbolForName(self Language, string_ *byte, length uint32, isNamed bool) Symbol

LanguageSymbolForName wraps ts_language_symbol_for_name. It panics if the library cannot be loaded or lacks the symbol.

func LookaheadIteratorCurrentSymbol

func LookaheadIteratorCurrentSymbol(self LookaheadIterator) Symbol

LookaheadIteratorCurrentSymbol wraps ts_lookahead_iterator_current_symbol. It panics if the library cannot be loaded or lacks the symbol.

func NodeGrammarSymbol

func NodeGrammarSymbol(self Node) Symbol

NodeGrammarSymbol wraps ts_node_grammar_symbol. It panics if the library cannot be loaded or lacks the symbol.

func NodeSymbol

func NodeSymbol(self Node) Symbol

NodeSymbol wraps ts_node_symbol. It panics if the library cannot be loaded or lacks the symbol.

type SymbolError

type SymbolError struct {
	Symbol string
}

SymbolError reports that a symbol is absent from the loaded library, which happens when the installed version predates the symbol.

func (*SymbolError) Error

func (e *SymbolError) Error() string

type SymbolType

type SymbolType int32

SymbolType represents TSSymbolType.

const (
	SymbolRegular   SymbolType = 0
	SymbolAnonymous SymbolType = 1
	SymbolSupertype SymbolType = 2
	SymbolAuxiliary SymbolType = 3
)

func LanguageSymbolType

func LanguageSymbolType(self Language, symbol Symbol) SymbolType

LanguageSymbolType wraps ts_language_symbol_type. It panics if the library cannot be loaded or lacks the symbol.

func (SymbolType) String

func (e SymbolType) String() string

type Tree

type Tree uintptr

Tree is an opaque handle-like type for struct TSTree.

type TreeCursor

type TreeCursor struct {
	Tree    uintptr
	Id      uintptr
	Context [3]uint32
}

TreeCursor represents TSTreeCursor.

func TreeCursorCopy

func TreeCursorCopy(cursor *TreeCursor) TreeCursor

TreeCursorCopy wraps ts_tree_cursor_copy. It panics if the library cannot be loaded or lacks the symbol.

func TreeCursorNew

func TreeCursorNew(node Node) TreeCursor

TreeCursorNew wraps ts_tree_cursor_new. It panics if the library cannot be loaded or lacks the symbol.

type WasmEngine

type WasmEngine struct{}

WasmEngine is a placeholder for unresolved C type TSWasmEngine.

type WasmError

type WasmError struct {
	Kind    WasmErrorKind
	Message uintptr
}

WasmError represents TSWasmError.

type WasmErrorKind

type WasmErrorKind int32

WasmErrorKind represents TSWasmErrorKind.

const (
	WasmErrorNone        WasmErrorKind = 0
	WasmErrorParse       WasmErrorKind = 1
	WasmErrorCompile     WasmErrorKind = 2
	WasmErrorInstantiate WasmErrorKind = 3
	WasmErrorAllocate    WasmErrorKind = 4
)

func (WasmErrorKind) String

func (e WasmErrorKind) String() string

type WasmStore

type WasmStore struct{}

WasmStore is a placeholder for unresolved C type TSWasmStore.

Jump to

Keyboard shortcuts

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