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

    QueryError

    pub suberror QueryError {
    QueryError(kind~ : QueryErrorKind, offset~ : UInt)
    } derive(
    Debug
    )

    A query compilation error: its kind and the byte offset in the source.

    Quantifier

    pub(all) enum Quantifier {
    Zero
    ZeroOrOne
    ZeroOrMore
    One
    OneOrMore
    } derive(Eq,
    Debug
    )

    TSQuantifier; declaration order matches the C enum values.

    Query

    pub struct Query {
    // private fields
    }

    TSQuery - A tree query, compiled from a string of S-expressions. The query itself is immutable. The mutable state used in the process of executing the query is stored in a QueryCursor.

    Query::capture_count

    fn Query::capture_count(self : Query) -> Int

    ts_query_capture_count.

    Query::capture_name_bytes_for_id

    fn Query::capture_name_bytes_for_id(self : Query, index : Int) -> Bytes

    ts_query_capture_name_for_id (the UTF-8 bytes of the name).

    Query::capture_name_for_id

    fn Query::capture_name_for_id(self : Query, index : Int) -> String

    ts_query_capture_name_for_id.

    Query::capture_quantifier_for_id

    fn Query::capture_quantifier_for_id(self : Query, pattern_index : Int, capture_index : Int) -> Quantifier

    ts_query_capture_quantifier_for_id.

    Query::copy

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

    ts_query_copy.

    Query::disable_capture

    fn Query::disable_capture(self : Query, name : StringView) -> Unit

    ts_query_disable_capture.

    Query::disable_pattern

    fn Query::disable_pattern(self : Query, pattern_index : Int) -> Unit

    ts_query_disable_pattern.

    Query::end_byte_for_pattern

    fn Query::end_byte_for_pattern(self : Query, pattern_index : Int) -> UInt

    ts_query_end_byte_for_pattern.

    Query::is_pattern_guaranteed_at_step

    fn Query::is_pattern_guaranteed_at_step(self : Query, byte_offset : UInt) -> Bool

    ts_query_is_pattern_guaranteed_at_step.

    Query::is_pattern_non_local

    fn Query::is_pattern_non_local(self : Query, pattern_index : Int) -> Bool

    ts_query_is_pattern_non_local.

    Query::is_pattern_rooted

    fn Query::is_pattern_rooted(self : Query, pattern_index : Int) -> Bool

    ts_query_is_pattern_rooted.

    Query::new

    ts_query_new: compile a query from its source (UTF-8 bytes).

    Query::pattern_count

    fn Query::pattern_count(self : Query) -> Int

    ts_query_pattern_count.

    Query::predicates_for_pattern

    fn Query::predicates_for_pattern(self : Query, pattern_index : Int) -> ArrayView[QueryPredicateStep]

    ts_query_predicates_for_pattern.

    Query::start_byte_for_pattern

    fn Query::start_byte_for_pattern(self : Query, pattern_index : Int) -> UInt

    ts_query_start_byte_for_pattern.

    Query::string_count

    fn Query::string_count(self : Query) -> Int

    ts_query_string_count.

    Query::string_value_bytes_for_id

    fn Query::string_value_bytes_for_id(self : Query, index : Int) -> Bytes

    ts_query_string_value_for_id (the bytes of the value).

    Query::string_value_for_id

    fn Query::string_value_for_id(self : Query, index : Int) -> String

    ts_query_string_value_for_id.

    QueryCapture

    pub(all) struct QueryCapture {
    node :
    Node

    index : Int
    }

    TSQueryCapture.

    QueryCursor

    pub struct QueryCursor {
    // private fields
    }

    TSQueryCursor - A stateful struct used to execute a query on a tree.

    QueryCursor::did_exceed_match_limit

    fn QueryCursor::did_exceed_match_limit(self : QueryCursor) -> Bool

    ts_query_cursor_did_exceed_match_limit.

    QueryCursor::exec

    ts_query_cursor_exec.

    QueryCursor::exec_with_options

    fn QueryCursor::exec_with_options(self : QueryCursor, query : Query, node :
    Node
    , query_options : QueryCursorOptions?) -> Unit

    ts_query_cursor_exec_with_options.

    QueryCursor::match_limit

    fn QueryCursor::match_limit(self : QueryCursor) -> UInt

    ts_query_cursor_match_limit.

    QueryCursor::new

    ts_query_cursor_new.

    QueryCursor::next_capture

    fn QueryCursor::next_capture(self : QueryCursor) -> (QueryMatch, Int)?

    ts_query_cursor_next_capture: the match and the index of the capture.

    QueryCursor::next_match

    fn QueryCursor::next_match(self : QueryCursor) -> QueryMatch?

    ts_query_cursor_next_match.

    QueryCursor::remove_match

    fn QueryCursor::remove_match(self : QueryCursor, match_id : UInt) -> Unit

    ts_query_cursor_remove_match.

    QueryCursor::set_byte_range

    fn QueryCursor::set_byte_range(self : QueryCursor, start_byte : UInt, end_byte : UInt) -> Bool

    ts_query_cursor_set_byte_range.

    QueryCursor::set_containing_byte_range

    fn QueryCursor::set_containing_byte_range(self : QueryCursor, start_byte : UInt, end_byte : UInt) -> Bool

    ts_query_cursor_set_containing_byte_range.

    QueryCursor::set_containing_point_range

    ts_query_cursor_set_containing_point_range.

    QueryCursor::set_match_limit

    fn QueryCursor::set_match_limit(self : QueryCursor, limit : UInt) -> Unit

    ts_query_cursor_set_match_limit.

    QueryCursor::set_max_start_depth

    fn QueryCursor::set_max_start_depth(self : QueryCursor, max_start_depth : UInt) -> Unit

    ts_query_cursor_set_max_start_depth.

    QueryCursor::set_point_range

    ts_query_cursor_set_point_range.

    QueryCursorOptions

    pub(all) struct QueryCursorOptions {
    progress_callback : (QueryCursorState) -> Bool?
    }

    TSQueryCursorOptions.

    QueryCursorState

    pub(all) struct QueryCursorState {
    current_byte_offset : UInt
    } derive(Eq,
    Debug
    )

    TSQueryCursorState: what a progress callback can observe.

    QueryErrorKind

    pub(all) enum QueryErrorKind {
    Syntax
    NodeType
    Field
    Capture
    Structure
    Language
    } derive(Eq,
    Debug
    )

    TSQueryError.

    QueryMatch

    pub(all) struct QueryMatch {
    id : UInt
    pattern_index : Int
    captures : Array[QueryCapture]
    }

    TSQueryMatch. captures is a copy of the match's capture list.

    QueryPredicateStep

    pub(all) struct QueryPredicateStep {
    type_ : QueryPredicateStepType
    value_id : Int
    } derive(Eq,
    Debug
    )

    TSQueryPredicateStep.

    QueryPredicateStepType

    pub(all) enum QueryPredicateStepType {
    Done
    Capture
    String
    } derive(Eq,
    Debug
    )

    TSQueryPredicateStepType.