feat!: bump internal abi to 15

This commit is contained in:
Amaan Qureshi 2024-10-26 01:12:01 -04:00
parent 413b7cbcca
commit ce93d8fd9b
6 changed files with 6 additions and 20 deletions

View file

@ -17,9 +17,8 @@ use super::{
};
const SMALL_STATE_THRESHOLD: usize = 64;
const ABI_VERSION_MIN: usize = 13;
const ABI_VERSION_MIN: usize = 14;
const ABI_VERSION_MAX: usize = tree_sitter::LANGUAGE_VERSION;
const ABI_VERSION_WITH_PRIMARY_STATES: usize = 14;
const BUILD_VERSION: &str = env!("CARGO_PKG_VERSION");
macro_rules! add {
@ -110,10 +109,7 @@ impl Generator {
}
self.add_non_terminal_alias_map();
if self.abi_version >= ABI_VERSION_WITH_PRIMARY_STATES {
self.add_primary_state_id_list();
}
self.add_primary_state_id_list();
let buffer_offset_before_lex_functions = self.buffer.len();
@ -1439,10 +1435,7 @@ impl Generator {
add_line!(self, "}},");
}
if self.abi_version >= ABI_VERSION_WITH_PRIMARY_STATES {
add_line!(self, ".primary_state_ids = ts_primary_state_ids,");
}
add_line!(self, ".primary_state_ids = ts_primary_state_ids,");
dedent!(self);
add_line!(self, "}};");
add_line!(self, "return &language;");

View file

@ -35,7 +35,7 @@ use url::Url;
const BUILD_VERSION: &str = env!("CARGO_PKG_VERSION");
const BUILD_SHA: Option<&'static str> = option_env!("BUILD_SHA");
const DEFAULT_GENERATE_ABI_VERSION: usize = 14;
const DEFAULT_GENERATE_ABI_VERSION: usize = 15;
#[derive(Subcommand)]
#[command(about="Generates and tests parsers", author=crate_authors!("\n"), styles=get_styles())]

View file

@ -1,6 +1,6 @@
/* automatically generated by rust-bindgen 0.70.1 */
pub const TREE_SITTER_LANGUAGE_VERSION: u32 = 14;
pub const TREE_SITTER_LANGUAGE_VERSION: u32 = 15;
pub const TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION: u32 = 13;
pub type TSStateId = u16;
pub type TSSymbol = u16;

View file

@ -26,7 +26,7 @@ extern "C" {
* The Tree-sitter library is generally backwards-compatible with languages
* generated using older CLI versions, but is not forwards-compatible.
*/
#define TREE_SITTER_LANGUAGE_VERSION 14
#define TREE_SITTER_LANGUAGE_VERSION 15
/**
* The earliest ABI version that is supported by the current version of the

View file

@ -11,7 +11,6 @@ extern "C" {
#define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1)
#define LANGUAGE_VERSION_WITH_PRIMARY_STATES 14
#define LANGUAGE_VERSION_USABLE_VIA_WASM 13
typedef struct {
const TSParseAction *actions;

View file

@ -1201,12 +1201,6 @@ const TSLanguage *ts_wasm_store_load_language(
const uint8_t *memory = wasmtime_memory_data(context, &self->memory);
memcpy(&wasm_language, &memory[language_address], sizeof(LanguageInWasmMemory));
if (wasm_language.version < LANGUAGE_VERSION_USABLE_VIA_WASM) {
wasm_error->kind = TSWasmErrorKindInstantiate;
format(&wasm_error->message, "language version %u is too old for wasm", wasm_language.version);
goto error;
}
int32_t addresses[] = {
wasm_language.alias_map,
wasm_language.alias_sequences,