⬆️ tree-sitter-cli

Fixes #46
This commit is contained in:
Max Brunsfeld 2019-05-01 12:28:29 -07:00
parent 58a475fcdf
commit 97e13b8145
3 changed files with 163 additions and 280 deletions

View File

@ -16,7 +16,7 @@
"devDependencies": {
"nodemon": "^1.18.3",
"prebuild": "^7.6.1",
"tree-sitter-cli": "^0.14.5"
"tree-sitter-cli": "^0.14.7"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",

8
src/binding.cc vendored
View File

@ -10,17 +10,17 @@ namespace {
NAN_METHOD(New) {}
void Init(Handle<Object> exports, Handle<Object> module) {
void Init(Local<Object> exports, Local<Object> module) {
Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
tpl->SetClassName(Nan::New("Language").ToLocalChecked());
tpl->InstanceTemplate()->SetInternalFieldCount(1);
Local<Function> constructor = tpl->GetFunction();
Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_bash());
instance->Set(Nan::New("name").ToLocalChecked(), Nan::New("bash").ToLocalChecked());
module->Set(Nan::New("exports").ToLocalChecked(), instance);
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("bash").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}
NODE_MODULE(tree_sitter_bash_binding, Init)

433
src/parser.c vendored

File diff suppressed because it is too large Load Diff