mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 15:19:55 -06:00
First commit
This commit is contained in:
commit
9392139a9c
47 changed files with 9107 additions and 0 deletions
20
bindings/node/binding.cc
generated
Normal file
20
bindings/node/binding.cc
generated
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <napi.h>
|
||||
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
||||
extern "C" TSLanguage *tree_sitter_YOUR_LANGUAGE_NAME();
|
||||
|
||||
// "tree-sitter", "language" hashed with BLAKE2
|
||||
const napi_type_tag LANGUAGE_TYPE_TAG = {
|
||||
0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
|
||||
};
|
||||
|
||||
Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
exports["name"] = Napi::String::New(env, "YOUR_LANGUAGE_NAME");
|
||||
auto language = Napi::External<TSLanguage>::New(env, tree_sitter_YOUR_LANGUAGE_NAME());
|
||||
language.TypeTag(&LANGUAGE_TYPE_TAG);
|
||||
exports["language"] = language;
|
||||
return exports;
|
||||
}
|
||||
|
||||
NODE_API_MODULE(tree_sitter_YOUR_LANGUAGE_NAME_binding, Init)
|
||||
Loading…
Add table
Add a link
Reference in a new issue