1 #include <emscripten.h>
128 char *
buffer = (
char *)payload;
176 for (
unsigned i = 0;
i < range_count;
i++) {
215 unsigned range_count;
217 for (
unsigned i = 0;
i < range_count;
i++) {
447 const void **result =
NULL;
450 const void **address = result;
468 const void **result =
NULL;
471 const void **address = result;
492 if (set[
i] ==
value)
return true;
493 if (set[
i] >
value)
break;
510 if (end_point.
row == 0 && end_point.
column == 0) {
518 bool already_visited_children =
false;
522 if (!already_visited_children) {
527 already_visited_children =
false;
530 already_visited_children =
true;
542 marshal_node(result.contents + result.size - 5, descendant);
547 already_visited_children =
false;
549 already_visited_children =
false;
552 already_visited_children =
true;
556 already_visited_children =
false;
601 if (match_limit == 0) {
621 result.contents[index++] = (
const void *)(
uint32_t)
match.pattern_index;
622 result.contents[index++] = (
const void *)(
uint32_t)
match.capture_count;
623 for (
unsigned i = 0;
i <
match.capture_count;
i++) {
625 result.contents[index++] = (
const void *)capture->
index;
631 bool did_exceed_match_limit =
648 if (match_limit == 0) {
661 unsigned capture_count = 0;
674 result.contents[index++] = (
const void *)(
uint32_t)
match.pattern_index;
675 result.contents[index++] = (
const void *)(
uint32_t)
match.capture_count;
676 result.contents[index++] = (
const void *)(
uint32_t)capture_index;
677 for (
unsigned i = 0;
i <
match.capture_count;
i++) {
679 result.contents[index++] = (
const void *)capture->
index;
685 bool did_exceed_match_limit =
void ts_query_cursor_exec(TSQueryCursor *, const TSQuery *, TSNode)
TSNode ts_node_descendant_for_byte_range(TSNode, uint32_t, uint32_t)
bool ts_node_has_changes(TSNode)
void ts_tree_edit(TSTree *self, const TSInputEdit *edit)
TSRange * ts_tree_get_changed_ranges(const TSTree *old_tree, const TSTree *new_tree, uint32_t *length)
TSNode ts_node_child_by_field_id(TSNode, TSFieldId)
TSTree * ts_parser_parse(TSParser *self, const TSTree *old_tree, TSInput input)
#define TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION
void ts_query_cursor_set_match_limit(TSQueryCursor *, uint32_t)
bool ts_tree_cursor_goto_next_sibling(TSTreeCursor *)
void ts_tree_cursor_delete(TSTreeCursor *)
TSNode ts_node_named_child(TSNode, uint32_t)
TSNode ts_node_next_named_sibling(TSNode)
uint32_t ts_node_start_byte(TSNode)
char * ts_node_string(TSNode)
TSNode ts_node_child(TSNode, uint32_t)
uint32_t ts_node_named_child_count(TSNode)
void ts_tree_cursor_reset(TSTreeCursor *, TSNode)
bool ts_query_cursor_did_exceed_match_limit(const TSQueryCursor *)
TSNode ts_node_prev_named_sibling(TSNode)
TSNode ts_node_prev_sibling(TSNode)
TSSymbol ts_node_symbol(TSNode)
bool ts_parser_set_included_ranges(TSParser *self, const TSRange *ranges, uint32_t length)
TSPoint ts_node_start_point(TSNode)
#define TREE_SITTER_LANGUAGE_VERSION
bool ts_query_cursor_next_match(TSQueryCursor *, TSQueryMatch *match)
bool ts_node_is_missing(TSNode)
TSTreeCursor ts_tree_cursor_new(TSNode)
TSNode ts_tree_root_node(const TSTree *self)
bool ts_tree_cursor_goto_parent(TSTreeCursor *)
void ts_parser_set_logger(TSParser *self, TSLogger logger)
TSQueryCursor * ts_query_cursor_new(void)
uint32_t ts_node_child_count(TSNode)
bool ts_node_has_error(TSNode)
uint32_t ts_node_end_byte(TSNode)
TSParser * ts_parser_new(void)
TSFieldId ts_tree_cursor_current_field_id(const TSTreeCursor *)
bool ts_node_is_named(TSNode)
bool ts_query_cursor_next_capture(TSQueryCursor *, TSQueryMatch *match, uint32_t *capture_index)
TSNode ts_node_parent(TSNode)
TSNode ts_node_named_descendant_for_point_range(TSNode, TSPoint, TSPoint)
TSSymbolType ts_language_symbol_type(const TSLanguage *, TSSymbol)
TSNode ts_tree_cursor_current_node(const TSTreeCursor *)
void ts_query_cursor_set_point_range(TSQueryCursor *, TSPoint, TSPoint)
TSNode ts_node_descendant_for_point_range(TSNode, TSPoint, TSPoint)
TSNode ts_node_next_sibling(TSNode)
TSPoint ts_node_end_point(TSNode)
TSNode ts_node_named_descendant_for_byte_range(TSNode, uint32_t, uint32_t)
bool ts_tree_cursor_goto_first_child(TSTreeCursor *)
#define array_grow_by(self, count)
RzList * symbols(RzBinFile *bf)
static TSInputEdit unmarshal_edit()
bool ts_tree_cursor_current_node_is_named_wasm(const TSTree *tree)
void ts_tree_cursor_start_position_wasm(const TSTree *tree)
void ts_tree_edit_wasm(TSTree *tree)
uint32_t ts_tree_cursor_current_field_id_wasm(const TSTree *tree)
void ts_node_descendant_for_position_wasm(const TSTree *tree)
uint32_t ts_node_start_index_wasm(const TSTree *tree)
uint32_t ts_node_end_index_wasm(const TSTree *tree)
void ts_tree_cursor_end_position_wasm(const TSTree *tree)
int ts_node_is_named_wasm(const TSTree *tree)
static TSNode unmarshal_node(const TSTree *tree)
static TSQueryCursor * scratch_query_cursor
bool ts_tree_cursor_current_node_is_missing_wasm(const TSTree *tree)
void ts_node_descendants_of_type_wasm(const TSTree *tree, const uint32_t *symbols, uint32_t symbol_count, uint32_t start_row, uint32_t start_column, uint32_t end_row, uint32_t end_column)
bool symbols_contain(const uint32_t *set, uint32_t length, uint32_t value)
void ts_node_child_wasm(const TSTree *tree, uint32_t index)
int ts_node_has_changes_wasm(const TSTree *tree)
uint32_t ts_tree_cursor_end_index_wasm(const TSTree *tree)
void ts_parser_new_wasm()
void ts_node_named_children_wasm(const TSTree *tree)
void ts_node_named_descendant_for_index_wasm(const TSTree *tree)
uint32_t ts_node_named_child_count_wasm(const TSTree *tree)
void ts_tree_get_changed_ranges_wasm(TSTree *tree, TSTree *other)
uint32_t ts_tree_cursor_start_index_wasm(const TSTree *tree)
uint32_t ts_node_child_count_wasm(const TSTree *tree)
static void marshal_cursor(const TSTreeCursor *cursor)
static TSPoint unmarshal_point(const void **address)
static void unmarshal_range(TSRange *range)
void ts_node_parent_wasm(const TSTree *tree)
void ts_parser_enable_logger_wasm(TSParser *self, bool should_log)
void tree_sitter_log_callback(bool is_lex_message, const char *message)
void tree_sitter_parse_callback(char *input_buffer, uint32_t index, uint32_t row, uint32_t column, uint32_t *length_read)
int ts_node_is_missing_wasm(const TSTree *tree)
uint16_t ts_node_symbol_wasm(const TSTree *tree)
void ts_node_start_point_wasm(const TSTree *tree)
void ts_node_named_descendant_for_position_wasm(const TSTree *tree)
void ts_node_children_wasm(const TSTree *tree)
void ts_tree_cursor_current_node_wasm(const TSTree *tree)
void ts_tree_root_node_wasm(const TSTree *tree)
void ts_node_prev_sibling_wasm(const TSTree *tree)
static void marshal_range(TSRange *range)
void ts_query_matches_wasm(const TSQuery *self, const TSTree *tree, uint32_t start_row, uint32_t start_column, uint32_t end_row, uint32_t end_column, uint32_t match_limit)
static const char * call_parse_callback(void *payload, uint32_t byte, TSPoint position, uint32_t *bytes_read)
int ts_language_type_is_named_wasm(const TSLanguage *self, TSSymbol typeId)
const void * TRANSFER_BUFFER[12]
void ts_query_captures_wasm(const TSQuery *self, const TSTree *tree, uint32_t start_row, uint32_t start_column, uint32_t end_row, uint32_t end_column, uint32_t match_limit)
bool ts_tree_cursor_goto_parent_wasm(const TSTree *tree)
static const uint32_t INPUT_BUFFER_SIZE
void ts_node_end_point_wasm(const TSTree *tree)
static TSTreeCursor unmarshal_cursor(const void **buffer, const TSTree *tree)
bool ts_tree_cursor_goto_first_child_wasm(const TSTree *tree)
static void marshal_point(TSPoint point)
void ts_tree_cursor_delete_wasm(const TSTree *tree)
static void call_log_callback(void *payload, TSLogType log_type, const char *message)
void ts_node_next_sibling_wasm(const TSTree *tree)
void ts_tree_cursor_new_wasm(const TSTree *tree)
uint16_t ts_tree_cursor_current_node_type_id_wasm(const TSTree *tree)
void ts_node_named_child_wasm(const TSTree *tree, uint32_t index)
int ts_language_type_is_visible_wasm(const TSLanguage *self, TSSymbol typeId)
bool ts_tree_cursor_goto_next_sibling_wasm(const TSTree *tree)
static void marshal_node(const void **buffer, TSNode node)
TSTree * ts_parser_parse_wasm(TSParser *self, char *input_buffer, const TSTree *old_tree, TSRange *ranges, uint32_t range_count)
void ts_tree_cursor_reset_wasm(const TSTree *tree)
const uint32_t ts_tree_cursor_current_node_id_wasm(const TSTree *tree)
char * ts_node_to_string_wasm(const TSTree *tree)
void ts_node_next_named_sibling_wasm(const TSTree *tree)
int ts_node_has_error_wasm(const TSTree *tree)
void ts_node_descendant_for_index_wasm(const TSTree *tree)
static uint32_t byte_to_code_unit(uint32_t byte)
static TSTreeCursor scratch_cursor
void ts_node_child_by_field_id_wasm(const TSTree *tree, uint32_t field_id)
static uint32_t code_unit_to_byte(uint32_t unit)
void ts_node_prev_named_sibling_wasm(const TSTree *tree)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
unsigned char match[65280+2]
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * calloc(size_t number, size_t size)
static bool point_lte(TSPoint a, TSPoint b)
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)