feat!: introduce parser introspection via the repo's Semantic Version baked in

This commit is contained in:
Amaan Qureshi 2024-02-12 02:27:17 -05:00
parent b66b1a7a92
commit 2c192fa038
No known key found for this signature in database
GPG key ID: E67890ADC4227273
15 changed files with 1862 additions and 2156 deletions

View file

@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen 0.69.4 */
pub const TREE_SITTER_LANGUAGE_VERSION: u32 = 14;
pub const TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION: u32 = 13;
pub const TREE_SITTER_LANGUAGE_VERSION: u32 = 15;
pub const TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION: u32 = 15;
pub type TSStateId = u16;
pub type TSSymbol = u16;
pub type TSFieldId = u16;
@ -721,7 +721,11 @@ extern "C" {
}
extern "C" {
#[doc = " Get the ABI version number for this language. This version number is used\n to ensure that languages were generated by a compatible version of\n Tree-sitter.\n\n See also [`ts_parser_set_language`]."]
pub fn ts_language_version(self_: *const TSLanguage) -> u32;
pub fn ts_language_abi_version(self_: *const TSLanguage) -> u32;
}
extern "C" {
#[doc = " Get the [Semantic Version](https://semver.org/) for this language. This\n version number is used to signal if a given parser might be incompatible\n with existing queries when upgraded between major versions.\n\n The Semantic Version is encoded as an unsigned 32-bit integer, where the\n major, minor, and patch version numbers are encoded in the 24 least significant\n bits of the integer, using 8 bits for each number.\n\n Layout of the returned integer:\n\n MSB LSB\n +--------+--------+--------+--------+\n |00000000| Major | Minor | Patch |\n +--------+--------+--------+--------+\n 31 24 23 16 15 8 7 0\n"]
pub fn ts_language_semantic_version(self_: *const TSLanguage) -> u32;
}
extern "C" {
#[doc = " Get the next parse state. Combine this with lookahead iterators to generate\n completion suggestions or valid symbols in error nodes. Use\n [`ts_node_grammar_symbol`] for valid symbols."]