From 572a60183c86920b0c1bc83941d70b3772534e3a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 17 May 2018 17:29:23 -0700 Subject: [PATCH] Suppress warnings associated w/ generated bindings --- build.rs | 1 + script/bindgen.sh | 2 +- src/bindings.rs | 333 +++++++++++++++++++++++++++++++++++++++++++++ src/ffi.rs | 335 +--------------------------------------------- 4 files changed, 338 insertions(+), 333 deletions(-) create mode 100644 src/bindings.rs diff --git a/build.rs b/build.rs index 4e2c3b8f..5fa5d408 100644 --- a/build.rs +++ b/build.rs @@ -36,6 +36,7 @@ fn main() { if env::var("RUST_TREE_SITTER_TEST").is_ok() { let parser_dir = Path::new("fixtures/tree-sitter-rust/src"); + config.flag_if_supported("-Wno-typedef-redefinition"); config.file(parser_dir.join("parser.c")); config.file(parser_dir.join("scanner.c")); } diff --git a/script/bindgen.sh b/script/bindgen.sh index 190e7a4f..1b9008b2 100755 --- a/script/bindgen.sh +++ b/script/bindgen.sh @@ -1,6 +1,6 @@ #!/bin/bash -output_path=src/ffi.rs +output_path=src/bindings.rs header_path='vendor/tree-sitter/include/tree_sitter/runtime.h' bindgen \ diff --git a/src/bindings.rs b/src/bindings.rs new file mode 100644 index 00000000..7d1c06e8 --- /dev/null +++ b/src/bindings.rs @@ -0,0 +1,333 @@ +/* automatically generated by rust-bindgen */ + +pub type FILE = [u64; 19usize]; +pub type TSSymbol = ::std::os::raw::c_ushort; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSLanguage { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSParser { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSTree { + _unused: [u8; 0], +} +pub const TSInputEncoding_TSInputEncodingUTF8: TSInputEncoding = 0; +pub const TSInputEncoding_TSInputEncodingUTF16: TSInputEncoding = 1; +pub type TSInputEncoding = u32; +pub const TSSymbolType_TSSymbolTypeRegular: TSSymbolType = 0; +pub const TSSymbolType_TSSymbolTypeAnonymous: TSSymbolType = 1; +pub const TSSymbolType_TSSymbolTypeAuxiliary: TSSymbolType = 2; +pub type TSSymbolType = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSPoint { + pub row: u32, + pub column: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSRange { + pub start: TSPoint, + pub end: TSPoint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSInput { + pub payload: *mut ::std::os::raw::c_void, + pub read: ::std::option::Option< + unsafe extern "C" fn(payload: *mut ::std::os::raw::c_void, bytes_read: *mut u32) + -> *const ::std::os::raw::c_char, + >, + pub seek: ::std::option::Option< + unsafe extern "C" fn( + payload: *mut ::std::os::raw::c_void, + byte_index: u32, + position: TSPoint, + ) -> ::std::os::raw::c_int, + >, + pub encoding: TSInputEncoding, +} +pub const TSLogType_TSLogTypeParse: TSLogType = 0; +pub const TSLogType_TSLogTypeLex: TSLogType = 1; +pub type TSLogType = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSLogger { + pub payload: *mut ::std::os::raw::c_void, + pub log: ::std::option::Option< + unsafe extern "C" fn( + payload: *mut ::std::os::raw::c_void, + arg1: TSLogType, + arg2: *const ::std::os::raw::c_char, + ), + >, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSInputEdit { + pub start_byte: u32, + pub old_end_byte: u32, + pub new_end_byte: u32, + pub start_point: TSPoint, + pub old_end_point: TSPoint, + pub new_end_point: TSPoint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSNode { + pub context: [u32; 4usize], + pub id: *const ::std::os::raw::c_void, + pub tree: *const ::std::os::raw::c_void, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TSTreeCursor { + pub context: [u32; 2usize], + pub id: *const ::std::os::raw::c_void, + pub tree: *const ::std::os::raw::c_void, +} +extern "C" { + #[link_name = "\u{1}_ts_parser_new"] + pub fn ts_parser_new() -> *mut TSParser; +} +extern "C" { + #[link_name = "\u{1}_ts_parser_delete"] + pub fn ts_parser_delete(arg1: *mut TSParser); +} +extern "C" { + #[link_name = "\u{1}_ts_parser_language"] + pub fn ts_parser_language(arg1: *const TSParser) -> *const TSLanguage; +} +extern "C" { + #[link_name = "\u{1}_ts_parser_set_language"] + pub fn ts_parser_set_language(arg1: *mut TSParser, arg2: *const TSLanguage) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_parser_logger"] + pub fn ts_parser_logger(arg1: *const TSParser) -> TSLogger; +} +extern "C" { + #[link_name = "\u{1}_ts_parser_set_logger"] + pub fn ts_parser_set_logger(arg1: *mut TSParser, arg2: TSLogger); +} +extern "C" { + #[link_name = "\u{1}_ts_parser_print_dot_graphs"] + pub fn ts_parser_print_dot_graphs(arg1: *mut TSParser, arg2: *mut FILE); +} +extern "C" { + #[link_name = "\u{1}_ts_parser_halt_on_error"] + pub fn ts_parser_halt_on_error(arg1: *mut TSParser, arg2: bool); +} +extern "C" { + #[link_name = "\u{1}_ts_parser_parse"] + pub fn ts_parser_parse(arg1: *mut TSParser, arg2: *const TSTree, arg3: TSInput) -> *mut TSTree; +} +extern "C" { + #[link_name = "\u{1}_ts_parser_parse_string"] + pub fn ts_parser_parse_string( + arg1: *mut TSParser, + arg2: *const TSTree, + arg3: *const ::std::os::raw::c_char, + arg4: u32, + ) -> *mut TSTree; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_copy"] + pub fn ts_tree_copy(arg1: *const TSTree) -> *mut TSTree; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_delete"] + pub fn ts_tree_delete(arg1: *mut TSTree); +} +extern "C" { + #[link_name = "\u{1}_ts_tree_root_node"] + pub fn ts_tree_root_node(arg1: *const TSTree) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_edit"] + pub fn ts_tree_edit(arg1: *mut TSTree, arg2: *const TSInputEdit); +} +extern "C" { + #[link_name = "\u{1}_ts_tree_get_changed_ranges"] + pub fn ts_tree_get_changed_ranges( + arg1: *const TSTree, + arg2: *const TSTree, + arg3: *mut u32, + ) -> *mut TSRange; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_print_dot_graph"] + pub fn ts_tree_print_dot_graph(arg1: *const TSTree, arg2: *mut FILE); +} +extern "C" { + #[link_name = "\u{1}_ts_node_start_byte"] + pub fn ts_node_start_byte(arg1: TSNode) -> u32; +} +extern "C" { + #[link_name = "\u{1}_ts_node_start_point"] + pub fn ts_node_start_point(arg1: TSNode) -> TSPoint; +} +extern "C" { + #[link_name = "\u{1}_ts_node_end_byte"] + pub fn ts_node_end_byte(arg1: TSNode) -> u32; +} +extern "C" { + #[link_name = "\u{1}_ts_node_end_point"] + pub fn ts_node_end_point(arg1: TSNode) -> TSPoint; +} +extern "C" { + #[link_name = "\u{1}_ts_node_symbol"] + pub fn ts_node_symbol(arg1: TSNode) -> TSSymbol; +} +extern "C" { + #[link_name = "\u{1}_ts_node_type"] + pub fn ts_node_type(arg1: TSNode) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_ts_node_string"] + pub fn ts_node_string(arg1: TSNode) -> *mut ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_ts_node_eq"] + pub fn ts_node_eq(arg1: TSNode, arg2: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_is_null"] + pub fn ts_node_is_null(arg1: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_is_named"] + pub fn ts_node_is_named(arg1: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_is_missing"] + pub fn ts_node_is_missing(arg1: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_has_changes"] + pub fn ts_node_has_changes(arg1: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_has_error"] + pub fn ts_node_has_error(arg1: TSNode) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_node_parent"] + pub fn ts_node_parent(arg1: TSNode) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_child"] + pub fn ts_node_child(arg1: TSNode, arg2: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_named_child"] + pub fn ts_node_named_child(arg1: TSNode, arg2: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_child_count"] + pub fn ts_node_child_count(arg1: TSNode) -> u32; +} +extern "C" { + #[link_name = "\u{1}_ts_node_named_child_count"] + pub fn ts_node_named_child_count(arg1: TSNode) -> u32; +} +extern "C" { + #[link_name = "\u{1}_ts_node_next_sibling"] + pub fn ts_node_next_sibling(arg1: TSNode) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_next_named_sibling"] + pub fn ts_node_next_named_sibling(arg1: TSNode) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_prev_sibling"] + pub fn ts_node_prev_sibling(arg1: TSNode) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_prev_named_sibling"] + pub fn ts_node_prev_named_sibling(arg1: TSNode) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_first_child_for_byte"] + pub fn ts_node_first_child_for_byte(arg1: TSNode, arg2: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_first_named_child_for_byte"] + pub fn ts_node_first_named_child_for_byte(arg1: TSNode, arg2: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_descendant_for_byte_range"] + pub fn ts_node_descendant_for_byte_range(arg1: TSNode, arg2: u32, arg3: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_named_descendant_for_byte_range"] + pub fn ts_node_named_descendant_for_byte_range(arg1: TSNode, arg2: u32, arg3: u32) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_descendant_for_point_range"] + pub fn ts_node_descendant_for_point_range(arg1: TSNode, arg2: TSPoint, arg3: TSPoint) + -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_node_named_descendant_for_point_range"] + pub fn ts_node_named_descendant_for_point_range( + arg1: TSNode, + arg2: TSPoint, + arg3: TSPoint, + ) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_new"] + pub fn ts_tree_cursor_new(arg1: *const TSTree) -> TSTreeCursor; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_delete"] + pub fn ts_tree_cursor_delete(arg1: *mut TSTreeCursor); +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_goto_first_child"] + pub fn ts_tree_cursor_goto_first_child(arg1: *mut TSTreeCursor) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_goto_first_child_for_byte"] + pub fn ts_tree_cursor_goto_first_child_for_byte(arg1: *mut TSTreeCursor, arg2: u32) -> i64; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_goto_next_sibling"] + pub fn ts_tree_cursor_goto_next_sibling(arg1: *mut TSTreeCursor) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_goto_parent"] + pub fn ts_tree_cursor_goto_parent(arg1: *mut TSTreeCursor) -> bool; +} +extern "C" { + #[link_name = "\u{1}_ts_tree_cursor_current_node"] + pub fn ts_tree_cursor_current_node(arg1: *const TSTreeCursor) -> TSNode; +} +extern "C" { + #[link_name = "\u{1}_ts_language_symbol_count"] + pub fn ts_language_symbol_count(arg1: *const TSLanguage) -> u32; +} +extern "C" { + #[link_name = "\u{1}_ts_language_symbol_name"] + pub fn ts_language_symbol_name( + arg1: *const TSLanguage, + arg2: TSSymbol, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_ts_language_symbol_type"] + pub fn ts_language_symbol_type(arg1: *const TSLanguage, arg2: TSSymbol) -> TSSymbolType; +} +extern "C" { + #[link_name = "\u{1}_ts_language_version"] + pub fn ts_language_version(arg1: *const TSLanguage) -> u32; +} + +pub const TREE_SITTER_LANGUAGE_VERSION: usize = 8; diff --git a/src/ffi.rs b/src/ffi.rs index 7d1c06e8..323609e0 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -1,333 +1,4 @@ -/* automatically generated by rust-bindgen */ +#![allow(dead_code)] +#![allow(non_upper_case_globals)] -pub type FILE = [u64; 19usize]; -pub type TSSymbol = ::std::os::raw::c_ushort; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSLanguage { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSParser { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSTree { - _unused: [u8; 0], -} -pub const TSInputEncoding_TSInputEncodingUTF8: TSInputEncoding = 0; -pub const TSInputEncoding_TSInputEncodingUTF16: TSInputEncoding = 1; -pub type TSInputEncoding = u32; -pub const TSSymbolType_TSSymbolTypeRegular: TSSymbolType = 0; -pub const TSSymbolType_TSSymbolTypeAnonymous: TSSymbolType = 1; -pub const TSSymbolType_TSSymbolTypeAuxiliary: TSSymbolType = 2; -pub type TSSymbolType = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSPoint { - pub row: u32, - pub column: u32, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSRange { - pub start: TSPoint, - pub end: TSPoint, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSInput { - pub payload: *mut ::std::os::raw::c_void, - pub read: ::std::option::Option< - unsafe extern "C" fn(payload: *mut ::std::os::raw::c_void, bytes_read: *mut u32) - -> *const ::std::os::raw::c_char, - >, - pub seek: ::std::option::Option< - unsafe extern "C" fn( - payload: *mut ::std::os::raw::c_void, - byte_index: u32, - position: TSPoint, - ) -> ::std::os::raw::c_int, - >, - pub encoding: TSInputEncoding, -} -pub const TSLogType_TSLogTypeParse: TSLogType = 0; -pub const TSLogType_TSLogTypeLex: TSLogType = 1; -pub type TSLogType = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSLogger { - pub payload: *mut ::std::os::raw::c_void, - pub log: ::std::option::Option< - unsafe extern "C" fn( - payload: *mut ::std::os::raw::c_void, - arg1: TSLogType, - arg2: *const ::std::os::raw::c_char, - ), - >, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSInputEdit { - pub start_byte: u32, - pub old_end_byte: u32, - pub new_end_byte: u32, - pub start_point: TSPoint, - pub old_end_point: TSPoint, - pub new_end_point: TSPoint, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSNode { - pub context: [u32; 4usize], - pub id: *const ::std::os::raw::c_void, - pub tree: *const ::std::os::raw::c_void, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TSTreeCursor { - pub context: [u32; 2usize], - pub id: *const ::std::os::raw::c_void, - pub tree: *const ::std::os::raw::c_void, -} -extern "C" { - #[link_name = "\u{1}_ts_parser_new"] - pub fn ts_parser_new() -> *mut TSParser; -} -extern "C" { - #[link_name = "\u{1}_ts_parser_delete"] - pub fn ts_parser_delete(arg1: *mut TSParser); -} -extern "C" { - #[link_name = "\u{1}_ts_parser_language"] - pub fn ts_parser_language(arg1: *const TSParser) -> *const TSLanguage; -} -extern "C" { - #[link_name = "\u{1}_ts_parser_set_language"] - pub fn ts_parser_set_language(arg1: *mut TSParser, arg2: *const TSLanguage) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_parser_logger"] - pub fn ts_parser_logger(arg1: *const TSParser) -> TSLogger; -} -extern "C" { - #[link_name = "\u{1}_ts_parser_set_logger"] - pub fn ts_parser_set_logger(arg1: *mut TSParser, arg2: TSLogger); -} -extern "C" { - #[link_name = "\u{1}_ts_parser_print_dot_graphs"] - pub fn ts_parser_print_dot_graphs(arg1: *mut TSParser, arg2: *mut FILE); -} -extern "C" { - #[link_name = "\u{1}_ts_parser_halt_on_error"] - pub fn ts_parser_halt_on_error(arg1: *mut TSParser, arg2: bool); -} -extern "C" { - #[link_name = "\u{1}_ts_parser_parse"] - pub fn ts_parser_parse(arg1: *mut TSParser, arg2: *const TSTree, arg3: TSInput) -> *mut TSTree; -} -extern "C" { - #[link_name = "\u{1}_ts_parser_parse_string"] - pub fn ts_parser_parse_string( - arg1: *mut TSParser, - arg2: *const TSTree, - arg3: *const ::std::os::raw::c_char, - arg4: u32, - ) -> *mut TSTree; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_copy"] - pub fn ts_tree_copy(arg1: *const TSTree) -> *mut TSTree; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_delete"] - pub fn ts_tree_delete(arg1: *mut TSTree); -} -extern "C" { - #[link_name = "\u{1}_ts_tree_root_node"] - pub fn ts_tree_root_node(arg1: *const TSTree) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_edit"] - pub fn ts_tree_edit(arg1: *mut TSTree, arg2: *const TSInputEdit); -} -extern "C" { - #[link_name = "\u{1}_ts_tree_get_changed_ranges"] - pub fn ts_tree_get_changed_ranges( - arg1: *const TSTree, - arg2: *const TSTree, - arg3: *mut u32, - ) -> *mut TSRange; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_print_dot_graph"] - pub fn ts_tree_print_dot_graph(arg1: *const TSTree, arg2: *mut FILE); -} -extern "C" { - #[link_name = "\u{1}_ts_node_start_byte"] - pub fn ts_node_start_byte(arg1: TSNode) -> u32; -} -extern "C" { - #[link_name = "\u{1}_ts_node_start_point"] - pub fn ts_node_start_point(arg1: TSNode) -> TSPoint; -} -extern "C" { - #[link_name = "\u{1}_ts_node_end_byte"] - pub fn ts_node_end_byte(arg1: TSNode) -> u32; -} -extern "C" { - #[link_name = "\u{1}_ts_node_end_point"] - pub fn ts_node_end_point(arg1: TSNode) -> TSPoint; -} -extern "C" { - #[link_name = "\u{1}_ts_node_symbol"] - pub fn ts_node_symbol(arg1: TSNode) -> TSSymbol; -} -extern "C" { - #[link_name = "\u{1}_ts_node_type"] - pub fn ts_node_type(arg1: TSNode) -> *const ::std::os::raw::c_char; -} -extern "C" { - #[link_name = "\u{1}_ts_node_string"] - pub fn ts_node_string(arg1: TSNode) -> *mut ::std::os::raw::c_char; -} -extern "C" { - #[link_name = "\u{1}_ts_node_eq"] - pub fn ts_node_eq(arg1: TSNode, arg2: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_is_null"] - pub fn ts_node_is_null(arg1: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_is_named"] - pub fn ts_node_is_named(arg1: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_is_missing"] - pub fn ts_node_is_missing(arg1: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_has_changes"] - pub fn ts_node_has_changes(arg1: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_has_error"] - pub fn ts_node_has_error(arg1: TSNode) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_node_parent"] - pub fn ts_node_parent(arg1: TSNode) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_child"] - pub fn ts_node_child(arg1: TSNode, arg2: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_named_child"] - pub fn ts_node_named_child(arg1: TSNode, arg2: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_child_count"] - pub fn ts_node_child_count(arg1: TSNode) -> u32; -} -extern "C" { - #[link_name = "\u{1}_ts_node_named_child_count"] - pub fn ts_node_named_child_count(arg1: TSNode) -> u32; -} -extern "C" { - #[link_name = "\u{1}_ts_node_next_sibling"] - pub fn ts_node_next_sibling(arg1: TSNode) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_next_named_sibling"] - pub fn ts_node_next_named_sibling(arg1: TSNode) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_prev_sibling"] - pub fn ts_node_prev_sibling(arg1: TSNode) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_prev_named_sibling"] - pub fn ts_node_prev_named_sibling(arg1: TSNode) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_first_child_for_byte"] - pub fn ts_node_first_child_for_byte(arg1: TSNode, arg2: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_first_named_child_for_byte"] - pub fn ts_node_first_named_child_for_byte(arg1: TSNode, arg2: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_descendant_for_byte_range"] - pub fn ts_node_descendant_for_byte_range(arg1: TSNode, arg2: u32, arg3: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_named_descendant_for_byte_range"] - pub fn ts_node_named_descendant_for_byte_range(arg1: TSNode, arg2: u32, arg3: u32) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_descendant_for_point_range"] - pub fn ts_node_descendant_for_point_range(arg1: TSNode, arg2: TSPoint, arg3: TSPoint) - -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_node_named_descendant_for_point_range"] - pub fn ts_node_named_descendant_for_point_range( - arg1: TSNode, - arg2: TSPoint, - arg3: TSPoint, - ) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_new"] - pub fn ts_tree_cursor_new(arg1: *const TSTree) -> TSTreeCursor; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_delete"] - pub fn ts_tree_cursor_delete(arg1: *mut TSTreeCursor); -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_goto_first_child"] - pub fn ts_tree_cursor_goto_first_child(arg1: *mut TSTreeCursor) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_goto_first_child_for_byte"] - pub fn ts_tree_cursor_goto_first_child_for_byte(arg1: *mut TSTreeCursor, arg2: u32) -> i64; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_goto_next_sibling"] - pub fn ts_tree_cursor_goto_next_sibling(arg1: *mut TSTreeCursor) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_goto_parent"] - pub fn ts_tree_cursor_goto_parent(arg1: *mut TSTreeCursor) -> bool; -} -extern "C" { - #[link_name = "\u{1}_ts_tree_cursor_current_node"] - pub fn ts_tree_cursor_current_node(arg1: *const TSTreeCursor) -> TSNode; -} -extern "C" { - #[link_name = "\u{1}_ts_language_symbol_count"] - pub fn ts_language_symbol_count(arg1: *const TSLanguage) -> u32; -} -extern "C" { - #[link_name = "\u{1}_ts_language_symbol_name"] - pub fn ts_language_symbol_name( - arg1: *const TSLanguage, - arg2: TSSymbol, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - #[link_name = "\u{1}_ts_language_symbol_type"] - pub fn ts_language_symbol_type(arg1: *const TSLanguage, arg2: TSSymbol) -> TSSymbolType; -} -extern "C" { - #[link_name = "\u{1}_ts_language_version"] - pub fn ts_language_version(arg1: *const TSLanguage) -> u32; -} - -pub const TREE_SITTER_LANGUAGE_VERSION: usize = 8; +include!("./bindings.rs");