Skip to content

Commit 8cd3ce6

Browse files
authored
Regenerate tree-sitter-preproc grammars (mozilla#986)
* Update tree-sitter-preproc * Update snapshots
1 parent b02bf55 commit 8cd3ce6

File tree

12 files changed

+202
-70
lines changed

12 files changed

+202
-70
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tree-sitter-typescript = "=0.20.1"
3333
tree-sitter-javascript = "=0.20.0"
3434
tree-sitter-python = "=0.20.2"
3535
tree-sitter-rust = "=0.20.3"
36-
tree-sitter-preproc = { path = "./tree-sitter-preproc", version = "=0.20.0" }
36+
tree-sitter-preproc = { path = "./tree-sitter-preproc", version = "=0.20.1" }
3737
tree-sitter-ccomment = { path = "./tree-sitter-ccomment", version = "=0.20.0" }
3838
tree-sitter-mozcpp = { path = "./tree-sitter-mozcpp", version = "=0.20.1" }
3939
tree-sitter-mozjs = { path = "./tree-sitter-mozjs", version = "=0.20.0" }

enums/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tree-sitter-typescript = "=0.20.1"
1414
tree-sitter-javascript = "=0.20.0"
1515
tree-sitter-python = "=0.20.2"
1616
tree-sitter-rust = "=0.20.3"
17-
tree-sitter-preproc = { path = "../tree-sitter-preproc", version = "=0.20.0" }
17+
tree-sitter-preproc = { path = "../tree-sitter-preproc", version = "=0.20.1" }
1818
tree-sitter-ccomment = { path = "../tree-sitter-ccomment", version = "=0.20.0" }
1919
tree-sitter-mozcpp = { path = "../tree-sitter-mozcpp", version = "=0.20.1" }
2020
tree-sitter-mozjs = { path = "../tree-sitter-mozjs", version = "=0.20.0" }

tests/repositories/rca-output

tree-sitter-preproc/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tree-sitter-preproc"
33
description = "Preproc grammar for the tree-sitter parsing library"
4-
version = "0.20.0"
4+
version = "0.20.1"
55
authors = ["Calixte Denizet <[email protected]>"]
66
license = "MIT"
77
readme = "bindings/rust/README.md"
@@ -21,7 +21,7 @@ include = [
2121
path = "bindings/rust/lib.rs"
2222

2323
[dependencies]
24-
tree-sitter = "0.20.0"
24+
tree-sitter = "0.20.9"
2525

2626
[build-dependencies]
2727
cc = "^1.0"

tree-sitter-preproc/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"sources": [
1010
"src/parser.c",
11-
"src/binding.cc"
11+
"bindings/node/binding.cc"
1212
],
1313
"cflags_c": [
1414
"-std=c99",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "tree_sitter/parser.h"
2+
#include <node.h>
3+
#include "nan.h"
4+
5+
using namespace v8;
6+
7+
extern "C" TSLanguage * tree_sitter_preproc();
8+
9+
namespace {
10+
11+
NAN_METHOD(New) {}
12+
13+
void Init(Local<Object> exports, Local<Object> module) {
14+
Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
15+
tpl->SetClassName(Nan::New("Language").ToLocalChecked());
16+
tpl->InstanceTemplate()->SetInternalFieldCount(1);
17+
18+
Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
19+
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
20+
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_preproc());
21+
22+
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("preproc").ToLocalChecked());
23+
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
24+
}
25+
26+
NODE_MODULE(tree_sitter_preproc_binding, Init)
27+
28+
} // namespace
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
try {
2+
module.exports = require("../../build/Release/tree_sitter_preproc_binding");
3+
} catch (error1) {
4+
if (error1.code !== 'MODULE_NOT_FOUND') {
5+
throw error1;
6+
}
7+
try {
8+
module.exports = require("../../build/Debug/tree_sitter_preproc_binding");
9+
} catch (error2) {
10+
if (error2.code !== 'MODULE_NOT_FOUND') {
11+
throw error2;
12+
}
13+
throw error1
14+
}
15+
}
16+
17+
try {
18+
module.exports.nodeTypeInfo = require("../../src/node-types.json");
19+
} catch (_) {}

tree-sitter-preproc/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

tree-sitter-preproc/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "tree-sitter-preproc",
3-
"version": "0.19.0",
3+
"version": "0.20.0",
44
"description": "Preproc grammar for node-tree-sitter",
5-
"main": "index.js",
5+
"main": "bindings/node",
66
"keywords": [
77
"parser",
88
"lexer"
@@ -13,7 +13,7 @@
1313
"nan": "^2.14.2"
1414
},
1515
"devDependencies": {
16-
"tree-sitter-cli": "^0.19.3"
16+
"tree-sitter-cli": "^0.20.7"
1717
},
1818
"scripts": {
1919
"build": "tree-sitter generate && node-gyp build",

tree-sitter-preproc/src/binding.cc

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)