diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 0db1f554..30e5b405 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -14,12 +14,12 @@ rust-version.workspace = true build = "binding_rust/build.rs" include = [ - "/binding_rust/*", - "/Cargo.toml", - "/include/*", - "/src/*.h", - "/src/*.c", - "/src/unicode/*", + "/binding_rust/*", + "/Cargo.toml", + "/src/*.h", + "/src/*.c", + "/src/unicode/*", + "/include/tree_sitter/api.h", ] [features] diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 32d61b45..30579e35 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -42,7 +42,7 @@ pub const LANGUAGE_VERSION: usize = ffi::TREE_SITTER_LANGUAGE_VERSION as usize; pub const MIN_COMPATIBLE_LANGUAGE_VERSION: usize = ffi::TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION as usize; -pub const PARSER_HEADER: &'static str = include_str!("../include/tree_sitter/parser.h"); +pub const PARSER_HEADER: &str = include_str!("../src/parser.h"); /// An opaque object that defines how to parse a particular language. The code for each /// `Language` is generated by the Tree-sitter CLI. diff --git a/lib/src/language.h b/lib/src/language.h index 55b5d89b..c89dc739 100644 --- a/lib/src/language.h +++ b/lib/src/language.h @@ -6,7 +6,7 @@ extern "C" { #endif #include "./subtree.h" -#include "tree_sitter/parser.h" +#include "./parser.h" #define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1) diff --git a/lib/src/lexer.h b/lib/src/lexer.h index c1a5bfdb..445c4fdc 100644 --- a/lib/src/lexer.h +++ b/lib/src/lexer.h @@ -8,7 +8,7 @@ extern "C" { #include "./length.h" #include "./subtree.h" #include "tree_sitter/api.h" -#include "tree_sitter/parser.h" +#include "./parser.h" typedef struct { TSLexer data; diff --git a/lib/include/tree_sitter/parser.h b/lib/src/parser.h similarity index 100% rename from lib/include/tree_sitter/parser.h rename to lib/src/parser.h diff --git a/lib/src/subtree.h b/lib/src/subtree.h index 76faff5e..8f97afa1 100644 --- a/lib/src/subtree.h +++ b/lib/src/subtree.h @@ -13,7 +13,7 @@ extern "C" { #include "./error_costs.h" #include "./host.h" #include "tree_sitter/api.h" -#include "tree_sitter/parser.h" +#include "./parser.h" #define TS_TREE_STATE_NONE USHRT_MAX #define NULL_SUBTREE ((Subtree) {.ptr = NULL}) diff --git a/lib/src/wasm.c b/lib/src/wasm.c index 379bd8c0..4fa2a6cb 100644 --- a/lib/src/wasm.c +++ b/lib/src/wasm.c @@ -1,5 +1,5 @@ #include "tree_sitter/api.h" -#include "tree_sitter/parser.h" +#include "./parser.h" #include #ifdef TREE_SITTER_FEATURE_WASM @@ -12,7 +12,6 @@ #include "./atomic.h" #include "./lexer.h" #include "./wasm.h" -#include "./lexer.h" #include "./wasm/wasm-stdlib.h" // The following symbols from the C and C++ standard libraries are available diff --git a/lib/src/wasm.h b/lib/src/wasm.h index 849a3c1c..c3324cc8 100644 --- a/lib/src/wasm.h +++ b/lib/src/wasm.h @@ -6,7 +6,7 @@ extern "C" { #endif #include "tree_sitter/api.h" -#include "tree_sitter/parser.h" +#include "./parser.h" bool ts_wasm_store_start(TSWasmStore *, TSLexer *, const TSLanguage *); void ts_wasm_store_stop(TSWasmStore *);