diff --git a/cli/generate/src/render.rs b/cli/generate/src/render.rs index 21952eae..71577380 100644 --- a/cli/generate/src/render.rs +++ b/cli/generate/src/render.rs @@ -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;"); diff --git a/cli/src/main.rs b/cli/src/main.rs index 7ff5c929..ae24f3fa 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -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())] diff --git a/lib/binding_rust/bindings.rs b/lib/binding_rust/bindings.rs index e7d17b16..24095fa0 100644 --- a/lib/binding_rust/bindings.rs +++ b/lib/binding_rust/bindings.rs @@ -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; diff --git a/lib/include/tree_sitter/api.h b/lib/include/tree_sitter/api.h index 73bcc136..63ff0cc2 100644 --- a/lib/include/tree_sitter/api.h +++ b/lib/include/tree_sitter/api.h @@ -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 diff --git a/lib/src/language.h b/lib/src/language.h index 4f267060..1e308122 100644 --- a/lib/src/language.h +++ b/lib/src/language.h @@ -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; diff --git a/lib/src/wasm_store.c b/lib/src/wasm_store.c index 7f25d6c2..98cc5420 100644 --- a/lib/src/wasm_store.c +++ b/lib/src/wasm_store.c @@ -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,