Init tree-sitter project

This commit is contained in:
Quentin Boyer 2026-01-18 18:37:34 +01:00
parent da3d0cd087
commit d24c53e0f9
30 changed files with 905 additions and 0 deletions

19
bindings/node/binding.cc generated Normal file
View file

@ -0,0 +1,19 @@
#include <napi.h>
typedef struct TSLanguage TSLanguage;
extern "C" TSLanguage *tree_sitter_vvk();
// "tree-sitter", "language" hashed with BLAKE2
const napi_type_tag LANGUAGE_TYPE_TAG = {
0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
};
Napi::Object Init(Napi::Env env, Napi::Object exports) {
auto language = Napi::External<TSLanguage>::New(env, tree_sitter_vvk());
language.TypeTag(&LANGUAGE_TYPE_TAG);
exports["language"] = language;
return exports;
}
NODE_API_MODULE(tree_sitter_vvk_binding, Init)