Restucture wasm module, return a normal TSLanguage from load_language

This commit is contained in:
Max Brunsfeld 2022-09-06 22:41:05 -07:00
parent 3f1a7f9cd4
commit 042e6f9d57
26 changed files with 3068 additions and 317 deletions

View file

@ -864,40 +864,29 @@ pub type TSWasmEngine = wasm_engine_t;
pub struct TSWasmStore {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TSWasmLanguage {
_unused: [u8; 0],
}
extern "C" {
pub fn ts_wasm_store_new(engine: *mut TSWasmEngine) -> *mut TSWasmStore;
}
extern "C" {
pub fn ts_wasm_store_delete(arg1: *mut TSWasmStore);
}
extern "C" {
pub fn ts_wasm_language_delete(arg1: *const TSWasmLanguage);
}
extern "C" {
pub fn ts_wasm_store_load_language(
arg1: *mut TSWasmStore,
name: *const ::std::os::raw::c_char,
wasm: *const ::std::os::raw::c_char,
wasm_len: u32,
) -> *mut TSWasmLanguage;
) -> *const TSLanguage;
}
extern "C" {
pub fn ts_wasm_store_add_language(arg1: *mut TSWasmStore, arg2: *const TSWasmLanguage);
}
extern "C" {
pub fn ts_parser_set_wasm_language(arg1: *mut TSParser, arg2: *const TSWasmLanguage);
}
extern "C" {
pub fn ts_parser_wasm_language(arg1: *mut TSParser) -> *const TSWasmLanguage;
pub fn ts_language_is_wasm(arg1: *const TSLanguage) -> bool;
}
extern "C" {
pub fn ts_parser_set_wasm_store(arg1: *mut TSParser, arg2: *mut TSWasmStore);
}
extern "C" {
pub fn ts_parser_wasm_store(arg1: *mut TSParser) -> *mut TSWasmStore;
}
extern "C" {
#[doc = " Set the allocation functions used by the library."]
#[doc = ""]