Rizin
unix-like reverse engineering framework and cli tools
|
#include <emscripten.h>
#include <tree_sitter/api.h>
#include <stdio.h>
#include "array.h"
#include "point.h"
Go to the source code of this file.
Variables | |
static const uint32_t | INPUT_BUFFER_SIZE = 10 * 1024 |
const void * | TRANSFER_BUFFER [12] |
static TSTreeCursor | scratch_cursor = {0} |
static TSQueryCursor * | scratch_query_cursor = NULL |
Definition at line 29 of file binding.c.
Referenced by call_parse_callback(), marshal_node(), marshal_point(), marshal_range(), ts_node_end_index_wasm(), ts_node_start_index_wasm(), ts_tree_cursor_end_index_wasm(), and ts_tree_cursor_start_index_wasm().
Definition at line 143 of file binding.c.
References message, tree_sitter_log_callback(), and TSLogTypeLex.
Referenced by ts_parser_enable_logger_wasm().
|
static |
Definition at line 122 of file binding.c.
References byte_to_code_unit(), code_unit_to_byte(), TSPoint::column, INPUT_BUFFER_SIZE, TSPoint::row, and tree_sitter_parse_callback().
Referenced by ts_parser_parse_wasm().
Definition at line 25 of file binding.c.
Referenced by call_parse_callback(), ts_node_descendant_for_index_wasm(), ts_node_descendants_of_type_wasm(), ts_node_named_descendant_for_index_wasm(), ts_query_captures_wasm(), ts_query_matches_wasm(), unmarshal_edit(), unmarshal_node(), unmarshal_point(), and unmarshal_range().
|
inlinestatic |
Definition at line 52 of file binding.c.
References TSTreeCursor::context, TSTreeCursor::id, and TRANSFER_BUFFER.
Referenced by ts_tree_cursor_goto_first_child_wasm(), ts_tree_cursor_goto_next_sibling_wasm(), ts_tree_cursor_goto_parent_wasm(), ts_tree_cursor_new_wasm(), and ts_tree_cursor_reset_wasm().
Definition at line 33 of file binding.c.
References byte_to_code_unit(), TSNode::context, and TSNode::id.
Referenced by ts_node_child_by_field_id_wasm(), ts_node_child_wasm(), ts_node_children_wasm(), ts_node_descendant_for_index_wasm(), ts_node_descendant_for_position_wasm(), ts_node_descendants_of_type_wasm(), ts_node_named_child_wasm(), ts_node_named_children_wasm(), ts_node_named_descendant_for_index_wasm(), ts_node_named_descendant_for_position_wasm(), ts_node_next_named_sibling_wasm(), ts_node_next_sibling_wasm(), ts_node_parent_wasm(), ts_node_prev_named_sibling_wasm(), ts_node_prev_sibling_wasm(), ts_query_captures_wasm(), ts_query_matches_wasm(), ts_tree_cursor_current_node_wasm(), and ts_tree_root_node_wasm().
|
static |
Definition at line 67 of file binding.c.
References byte_to_code_unit(), and TRANSFER_BUFFER.
Referenced by ts_node_end_point_wasm(), ts_node_start_point_wasm(), ts_tree_cursor_end_position_wasm(), and ts_tree_cursor_start_position_wasm().
|
static |
Definition at line 79 of file binding.c.
References byte_to_code_unit(), and capstone::range.
Referenced by ts_tree_get_changed_ranges_wasm().
Definition at line 490 of file binding.c.
References i, length, and value.
Referenced by ts_node_descendants_of_type_wasm().
Referenced by call_log_callback().
void tree_sitter_parse_callback | ( | char * | input_buffer, |
uint32_t | index, | ||
uint32_t | row, | ||
uint32_t | column, | ||
uint32_t * | length_read | ||
) |
Referenced by call_parse_callback().
void* ts_init | ( | ) |
Definition at line 19 of file binding.c.
References TRANSFER_BUFFER, TREE_SITTER_LANGUAGE_VERSION, and TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION.
int ts_language_type_is_named_wasm | ( | const TSLanguage * | self, |
TSSymbol | typeId | ||
) |
Definition at line 191 of file binding.c.
References ts_language_symbol_type(), and TSSymbolTypeRegular.
int ts_language_type_is_visible_wasm | ( | const TSLanguage * | self, |
TSSymbol | typeId | ||
) |
Definition at line 196 of file binding.c.
References ts_language_symbol_type(), and TSSymbolTypeAnonymous.
Definition at line 357 of file binding.c.
References field_id, marshal_node(), TRANSFER_BUFFER, ts_node_child_by_field_id(), and unmarshal_node().
Definition at line 347 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_child(), and unmarshal_node().
Definition at line 444 of file binding.c.
References calloc(), count, i, marshal_node(), NULL, scratch_cursor, TRANSFER_BUFFER, ts_node_child_count(), ts_tree_cursor_current_node(), ts_tree_cursor_goto_first_child(), ts_tree_cursor_goto_next_sibling(), ts_tree_cursor_reset(), and unmarshal_node().
Definition at line 387 of file binding.c.
References code_unit_to_byte(), test_evm::end, marshal_node(), start, TRANSFER_BUFFER, ts_node_descendant_for_byte_range(), and unmarshal_node().
Definition at line 403 of file binding.c.
References test_evm::end, marshal_node(), start, TRANSFER_BUFFER, ts_node_descendant_for_point_range(), unmarshal_node(), and unmarshal_point().
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 | ||
) |
Definition at line 498 of file binding.c.
References Array, array_grow_by, array_new, code_unit_to_byte(), TSPoint::column, marshal_node(), point_lte(), TSPoint::row, scratch_cursor, symbols(), symbols_contain(), TRANSFER_BUFFER, ts_node_end_point(), ts_node_start_point(), ts_node_symbol(), ts_tree_cursor_current_node(), ts_tree_cursor_goto_first_child(), ts_tree_cursor_goto_next_sibling(), ts_tree_cursor_goto_parent(), ts_tree_cursor_reset(), UINT32_MAX, and unmarshal_node().
Definition at line 434 of file binding.c.
References byte_to_code_unit(), ts_node_end_byte(), and unmarshal_node().
Definition at line 424 of file binding.c.
References marshal_point(), ts_node_end_point(), and unmarshal_node().
Definition at line 342 of file binding.c.
References ts_node_named_child_count(), and unmarshal_node().
Definition at line 352 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_named_child(), and unmarshal_node().
Definition at line 465 of file binding.c.
References calloc(), count, i, marshal_node(), NULL, scratch_cursor, TRANSFER_BUFFER, ts_node_is_named(), ts_node_named_child_count(), ts_tree_cursor_current_node(), ts_tree_cursor_goto_first_child(), ts_tree_cursor_goto_next_sibling(), ts_tree_cursor_reset(), and unmarshal_node().
Definition at line 395 of file binding.c.
References code_unit_to_byte(), test_evm::end, marshal_node(), start, TRANSFER_BUFFER, ts_node_named_descendant_for_byte_range(), and unmarshal_node().
Definition at line 411 of file binding.c.
References test_evm::end, marshal_node(), start, TRANSFER_BUFFER, ts_node_named_descendant_for_point_range(), unmarshal_node(), and unmarshal_point().
Definition at line 372 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_next_named_sibling(), and unmarshal_node().
Definition at line 362 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_next_sibling(), and unmarshal_node().
Definition at line 382 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_parent(), and unmarshal_node().
Definition at line 377 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_prev_named_sibling(), and unmarshal_node().
Definition at line 367 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_node_prev_sibling(), and unmarshal_node().
Definition at line 429 of file binding.c.
References byte_to_code_unit(), ts_node_start_byte(), and unmarshal_node().
Definition at line 419 of file binding.c.
References marshal_point(), ts_node_start_point(), and unmarshal_node().
Definition at line 332 of file binding.c.
References ts_node_symbol(), and unmarshal_node().
Definition at line 158 of file binding.c.
References call_log_callback(), NULL, and ts_parser_set_logger().
void ts_parser_new_wasm | ( | ) |
Definition at line 151 of file binding.c.
References calloc(), INPUT_BUFFER_SIZE, cmd_descs_generate::parser, TRANSFER_BUFFER, and ts_parser_new().
TSTree* ts_parser_parse_wasm | ( | TSParser * | self, |
char * | input_buffer, | ||
const TSTree * | old_tree, | ||
TSRange * | ranges, | ||
uint32_t | range_count | ||
) |
Definition at line 163 of file binding.c.
References call_parse_callback(), free(), i, input(), NULL, ts_parser_parse(), ts_parser_set_included_ranges(), TSInputEncodingUTF16, and unmarshal_range().
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 | ||
) |
Definition at line 638 of file binding.c.
References Array, array_grow_by, array_new, code_unit_to_byte(), i, TSQueryCapture::index, marshal_node(), match, TSQueryCapture::node, scratch_query_cursor, TRANSFER_BUFFER, ts_query_cursor_did_exceed_match_limit(), ts_query_cursor_exec(), ts_query_cursor_new(), ts_query_cursor_next_capture(), ts_query_cursor_set_match_limit(), ts_query_cursor_set_point_range(), UINT32_MAX, and unmarshal_node().
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 | ||
) |
Definition at line 591 of file binding.c.
References Array, array_grow_by, array_new, code_unit_to_byte(), i, TSQueryCapture::index, marshal_node(), match, TSQueryCapture::node, scratch_query_cursor, TRANSFER_BUFFER, ts_query_cursor_did_exceed_match_limit(), ts_query_cursor_exec(), ts_query_cursor_new(), ts_query_cursor_next_match(), ts_query_cursor_set_match_limit(), ts_query_cursor_set_point_range(), UINT32_MAX, and unmarshal_node().
Definition at line 315 of file binding.c.
References TRANSFER_BUFFER, ts_tree_cursor_current_field_id(), and unmarshal_cursor().
Definition at line 285 of file binding.c.
References TSNode::id, TRANSFER_BUFFER, ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 279 of file binding.c.
References TRANSFER_BUFFER, ts_node_is_missing(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 273 of file binding.c.
References TRANSFER_BUFFER, ts_node_is_named(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 267 of file binding.c.
References TRANSFER_BUFFER, ts_node_symbol(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 320 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 234 of file binding.c.
References TRANSFER_BUFFER, ts_tree_cursor_delete(), and unmarshal_cursor().
Definition at line 309 of file binding.c.
References byte_to_code_unit(), TRANSFER_BUFFER, ts_node_end_byte(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 297 of file binding.c.
References marshal_point(), TRANSFER_BUFFER, ts_node_end_point(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 246 of file binding.c.
References marshal_cursor(), TRANSFER_BUFFER, ts_tree_cursor_goto_first_child(), and unmarshal_cursor().
Definition at line 253 of file binding.c.
References marshal_cursor(), TRANSFER_BUFFER, ts_tree_cursor_goto_next_sibling(), and unmarshal_cursor().
Definition at line 260 of file binding.c.
References marshal_cursor(), TRANSFER_BUFFER, ts_tree_cursor_goto_parent(), and unmarshal_cursor().
Definition at line 228 of file binding.c.
References marshal_cursor(), ts_tree_cursor_new(), and unmarshal_node().
Definition at line 239 of file binding.c.
References marshal_cursor(), TRANSFER_BUFFER, ts_tree_cursor_reset(), unmarshal_cursor(), and unmarshal_node().
Definition at line 303 of file binding.c.
References byte_to_code_unit(), TRANSFER_BUFFER, ts_node_start_byte(), ts_tree_cursor_current_node(), and unmarshal_cursor().
Definition at line 291 of file binding.c.
References marshal_point(), TRANSFER_BUFFER, ts_node_start_point(), ts_tree_cursor_current_node(), and unmarshal_cursor().
void ts_tree_edit_wasm | ( | TSTree * | tree | ) |
Definition at line 209 of file binding.c.
References ts_tree_edit(), and unmarshal_edit().
Definition at line 214 of file binding.c.
References i, marshal_range(), TRANSFER_BUFFER, and ts_tree_get_changed_ranges().
Definition at line 205 of file binding.c.
References marshal_node(), TRANSFER_BUFFER, and ts_tree_root_node().
|
inlinestatic |
Definition at line 58 of file binding.c.
References TSTreeCursor::context, TSTreeCursor::id, and TSTreeCursor::tree.
Referenced by ts_tree_cursor_current_field_id_wasm(), ts_tree_cursor_current_node_id_wasm(), ts_tree_cursor_current_node_is_missing_wasm(), ts_tree_cursor_current_node_is_named_wasm(), ts_tree_cursor_current_node_type_id_wasm(), ts_tree_cursor_current_node_wasm(), ts_tree_cursor_delete_wasm(), ts_tree_cursor_end_index_wasm(), ts_tree_cursor_end_position_wasm(), ts_tree_cursor_goto_first_child_wasm(), ts_tree_cursor_goto_next_sibling_wasm(), ts_tree_cursor_goto_parent_wasm(), ts_tree_cursor_reset_wasm(), ts_tree_cursor_start_index_wasm(), and ts_tree_cursor_start_position_wasm().
|
static |
Definition at line 93 of file binding.c.
References code_unit_to_byte(), TSInputEdit::new_end_byte, TSInputEdit::new_end_point, TSInputEdit::old_end_byte, TSInputEdit::old_end_point, TSInputEdit::start_byte, TSInputEdit::start_point, TRANSFER_BUFFER, and unmarshal_point().
Referenced by ts_tree_edit_wasm().
Definition at line 41 of file binding.c.
References code_unit_to_byte(), TSNode::context, TSNode::id, TRANSFER_BUFFER, and TSNode::tree.
Referenced by ts_node_child_by_field_id_wasm(), ts_node_child_count_wasm(), ts_node_child_wasm(), ts_node_children_wasm(), ts_node_descendant_for_index_wasm(), ts_node_descendant_for_position_wasm(), ts_node_descendants_of_type_wasm(), ts_node_end_index_wasm(), ts_node_end_point_wasm(), ts_node_has_changes_wasm(), ts_node_has_error_wasm(), ts_node_is_missing_wasm(), ts_node_is_named_wasm(), ts_node_named_child_count_wasm(), ts_node_named_child_wasm(), ts_node_named_children_wasm(), ts_node_named_descendant_for_index_wasm(), ts_node_named_descendant_for_position_wasm(), ts_node_next_named_sibling_wasm(), ts_node_next_sibling_wasm(), ts_node_parent_wasm(), ts_node_prev_named_sibling_wasm(), ts_node_prev_sibling_wasm(), ts_node_start_index_wasm(), ts_node_start_point_wasm(), ts_node_symbol_wasm(), ts_node_to_string_wasm(), ts_query_captures_wasm(), ts_query_matches_wasm(), ts_tree_cursor_new_wasm(), and ts_tree_cursor_reset_wasm().
Definition at line 72 of file binding.c.
References code_unit_to_byte().
Referenced by ts_node_descendant_for_position_wasm(), ts_node_named_descendant_for_position_wasm(), and unmarshal_edit().
|
static |
Definition at line 86 of file binding.c.
References code_unit_to_byte(), and capstone::range.
Referenced by ts_parser_parse_wasm().
Definition at line 11 of file binding.c.
Referenced by call_parse_callback(), and ts_parser_new_wasm().
|
static |
Definition at line 329 of file binding.c.
Referenced by ts_node_children_wasm(), ts_node_descendants_of_type_wasm(), and ts_node_named_children_wasm().
|
static |
Definition at line 330 of file binding.c.
Referenced by ts_query_captures_wasm(), and ts_query_matches_wasm().
const void* TRANSFER_BUFFER[12] |
Definition at line 13 of file binding.c.
Referenced by marshal_cursor(), marshal_point(), ts_init(), ts_node_child_by_field_id_wasm(), ts_node_child_wasm(), ts_node_children_wasm(), ts_node_descendant_for_index_wasm(), ts_node_descendant_for_position_wasm(), ts_node_descendants_of_type_wasm(), ts_node_named_child_wasm(), ts_node_named_children_wasm(), ts_node_named_descendant_for_index_wasm(), ts_node_named_descendant_for_position_wasm(), ts_node_next_named_sibling_wasm(), ts_node_next_sibling_wasm(), ts_node_parent_wasm(), ts_node_prev_named_sibling_wasm(), ts_node_prev_sibling_wasm(), ts_parser_new_wasm(), ts_query_captures_wasm(), ts_query_matches_wasm(), ts_tree_cursor_current_field_id_wasm(), ts_tree_cursor_current_node_id_wasm(), ts_tree_cursor_current_node_is_missing_wasm(), ts_tree_cursor_current_node_is_named_wasm(), ts_tree_cursor_current_node_type_id_wasm(), ts_tree_cursor_current_node_wasm(), ts_tree_cursor_delete_wasm(), ts_tree_cursor_end_index_wasm(), ts_tree_cursor_end_position_wasm(), ts_tree_cursor_goto_first_child_wasm(), ts_tree_cursor_goto_next_sibling_wasm(), ts_tree_cursor_goto_parent_wasm(), ts_tree_cursor_reset_wasm(), ts_tree_cursor_start_index_wasm(), ts_tree_cursor_start_position_wasm(), ts_tree_get_changed_ranges_wasm(), ts_tree_root_node_wasm(), unmarshal_edit(), and unmarshal_node().