Skip to content

Commit

Permalink
feat: upgrade to [email protected]
Browse files Browse the repository at this point in the history
BREAKING CHANGE: require tree-sitter 0.19+
  • Loading branch information
ikatyang committed Mar 14, 2021
1 parent 5a139be commit b9baa05
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 120 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/build
/node_modules

/bindings/rust
/Cargo.toml
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "tree-sitter"]
path = tree-sitter
url = https://github.com/ikatyang/tree-sitter
branch = 0.18.0-custom
branch = v0.19.3-custom
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"sources": [
"src/parser.c",
"src/binding.cc",
"bindings/node/binding.cc",
"src/scanner.cc"
],
"cflags_c": [
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions bindings/node/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
try {
module.exports = require("../../build/Release/tree_sitter_markdown_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_markdown_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
}
throw error1
}
}

try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");
} catch (_) {}
13 changes: 0 additions & 13 deletions index.js

This file was deleted.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"parser",
"lexer"
],
"main": "index.js",
"main": "bindings/node",
"repository": "https://github.com/ikatyang/tree-sitter-markdown",
"homepage": "https://github.com/ikatyang/tree-sitter-markdown#readme",
"author": {
Expand Down Expand Up @@ -36,8 +36,7 @@
},
"files": [
"/src/",
"/binding.gyp",
"/grammar.js",
"/index.js"
"/bindings/node/",
"/grammar.js"
]
}
1 change: 1 addition & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

159 changes: 72 additions & 87 deletions src/tree_sitter/parser.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tree-sitter
Submodule tree-sitter updated 97 files
+101 −0 .github/workflows/ci.yml
+2 −0 .gitignore
+0 −70 .travis.yml
+332 −466 Cargo.lock
+1 −1 README.md
+15 −10 cli/Cargo.toml
+20 −7 cli/npm/dsl.d.ts
+16 −9 cli/npm/install.js
+1 −1 cli/npm/package.json
+16 −2 cli/src/error.rs
+121 −0 cli/src/generate/binding_files.rs
+233 −124 cli/src/generate/build_tables/build_parse_table.rs
+61 −23 cli/src/generate/build_tables/item.rs
+5 −12 cli/src/generate/build_tables/item_set_builder.rs
+8 −3 cli/src/generate/build_tables/minimize_parse_table.rs
+2 −4 cli/src/generate/build_tables/mod.rs
+2 −2 cli/src/generate/build_tables/token_conflicts.rs
+133 −0 cli/src/generate/char_tree.rs
+20 −2 cli/src/generate/dsl.js
+30 −4 cli/src/generate/grammars.rs
+6 −33 cli/src/generate/mod.rs
+474 −331 cli/src/generate/nfa.rs
+68 −48 cli/src/generate/node_types.rs
+0 −18 cli/src/generate/npm_files.rs
+65 −32 cli/src/generate/parse_grammar.rs
+2 −1 cli/src/generate/prepare_grammar/expand_repeats.rs
+141 −28 cli/src/generate/prepare_grammar/expand_tokens.rs
+12 −7 cli/src/generate/prepare_grammar/extract_default_aliases.rs
+3 −1 cli/src/generate/prepare_grammar/extract_tokens.rs
+30 −20 cli/src/generate/prepare_grammar/flatten_grammar.rs
+3 −1 cli/src/generate/prepare_grammar/intern_symbols.rs
+198 −5 cli/src/generate/prepare_grammar/mod.rs
+23 −20 cli/src/generate/prepare_grammar/process_inlines.rs
+1 −0 cli/src/generate/prepare_grammar/unicode-categories.json
+1 −0 cli/src/generate/prepare_grammar/unicode-properties.json
+152 −91 cli/src/generate/render.rs
+85 −13 cli/src/generate/rules.rs
+6 −14 cli/src/generate/tables.rs
+2 −1 cli/src/generate/templates/binding.gyp
+40 −0 cli/src/generate/templates/build.rs
+26 −0 cli/src/generate/templates/cargo.toml
+12 −6 cli/src/generate/templates/index.js
+52 −0 cli/src/generate/templates/lib.rs
+19 −0 cli/src/generate/templates/package.json
+120 −24 cli/src/highlight.rs
+1 −1 cli/src/loader.rs
+13 −3 cli/src/main.rs
+16 −11 cli/src/test.rs
+14 −3 cli/src/tests/corpus_test.rs
+0 −1 cli/src/tests/helpers/mod.rs
+1 −1 cli/src/tests/helpers/random.rs
+28 −2 cli/src/tests/node_test.rs
+1 −2 cli/src/tests/parser_test.rs
+1 −2 cli/src/tests/pathological_test.rs
+213 −4 cli/src/tests/query_test.rs
+1 −2 cli/src/tests/tags_test.rs
+2 −1 docs/index.md
+1 −1 docs/section-3-creating-parsers.md
+1 −1 highlight/Cargo.toml
+9 −1 lib/Cargo.toml
+16 −10 lib/binding_rust/allocations.rs
+15 −5 lib/binding_rust/bindings.rs
+3 −3 lib/binding_rust/build.rs
+15 −0 lib/binding_rust/lib.rs
+9 −60 lib/binding_rust/util.rs
+14 −0 lib/binding_web/binding.c
+56 −22 lib/binding_web/binding.js
+3 −0 lib/binding_web/exports.json
+1 −1 lib/binding_web/package.json
+44 −0 lib/binding_web/test/language-test.js
+26 −0 lib/binding_web/test/query-test.js
+6 −1 lib/binding_web/tree-sitter-web.d.ts
+13 −2 lib/include/tree_sitter/api.h
+72 −87 lib/include/tree_sitter/parser.h
+1 −1 lib/src/alloc.h
+3 −15 lib/src/language.c
+12 −26 lib/src/language.h
+9 −3 lib/src/node.c
+47 −24 lib/src/parser.c
+32 −50 lib/src/query.c
+6 −8 lib/src/tree_cursor.c
+2 −2 script/benchmark
+1 −1 script/benchmark.cmd
+1 −1 script/fetch-fixtures
+1 −1 script/fetch-fixtures.cmd
+1 −1 script/generate-fixtures
+1 −1 script/generate-fixtures.cmd
+128 −0 script/generate-unicode-categories-json
+14 −13 script/test
+0 −1 script/test.cmd
+1 −1 script/version
+1 −1 tags/Cargo.toml
+12 −0 test/fixtures/test_grammars/named_precedences/corpus.txt
+159 −0 test/fixtures/test_grammars/named_precedences/grammar.json
+3 −0 test/fixtures/test_grammars/named_precedences/readme.txt
+32 −0 test/fixtures/test_grammars/unicode_classes/corpus.txt
+36 −0 test/fixtures/test_grammars/unicode_classes/grammar.json

0 comments on commit b9baa05

Please sign in to comment.