Commit graph

3570 commits

Author SHA1 Message Date
Max Brunsfeld
9d0eedc01f Remove stray entry from wasm exported-symbol list 2021-05-20 14:33:25 -07:00
Max Brunsfeld
242e089379 web: 0.19.4 2021-05-20 14:29:39 -07:00
Max Brunsfeld
5664b77535 rust: 0.19.5 2021-05-20 14:29:25 -07:00
Max Brunsfeld
e386ebc3b6
Merge pull request #1119 from tree-sitter/remove-parent-node-cache
Remove interior mutability for parent-node caching in Tree
2021-05-20 14:20:39 -07:00
Max Brunsfeld
399b5e4daf Remove interior mutability for parent-node caching in Tree
In Rust binding, mark Tree as Sync
2021-05-20 13:56:26 -07:00
Max Brunsfeld
019148b304
Merge pull request #1118 from ahlinc/cargo-fmt
Apply 'cargo fmt' for the whole Rust code base
2021-05-20 12:10:50 -07:00
Max Brunsfeld
b8ff6447d7
Merge pull request #1112 from breandan/patch-1
Add link to Kotlin parser
2021-05-20 12:06:17 -07:00
Andrew Hlynskyi
96ad90a646 CI: Add 'cargo fmt -- --check' to ci.yml
The step is placed right after Rust installation to fail faster.
2021-05-19 23:21:43 +03:00
Andrew Hlynskyi
3c0152a331 chore(fmt): Apply 'cargo fmt' to the whole code base 2021-05-19 23:21:43 +03:00
Max Brunsfeld
cf06ac4f82
Merge pull request #1117 from markus-oberhumer/fix-const-correctness-part2
cli: Improve const-correctness of the generated parsers (part 2 of 2).
2021-05-19 08:37:48 -07:00
Markus F.X.J. Oberhumer
cc519b3121 cli: Improve const-correctness of the generated parsers (part 2 of 2).
This is a follow-up to my previous commit 1badd131f9 .

I've made this an extra patch as it requires a minor
API change in <tree_sitter/parser.h>.

This commit moves the remaining generated tables into
the read-only segment.

Before:
  $ for f in bash c cpp go html java javascript jsdoc json php python ruby rust; do \
       gcc -o $f.o -O2 -Ilib/include -c test/fixtures/grammars/$f/src/parser.c; \
    done
  $ size --totals *.o
      text    data     bss     dec     hex filename
   5353477   24472       0 5377949  520f9d (TOTALS)

After:
  $ for f in bash c cpp go html java javascript jsdoc json php python ruby rust; do \
       gcc -o $f.o -O2 -Ilib/include -c test/fixtures/grammars/$f/src/parser.c; \
    done
  $ size --totals *.o
   5378147       0       0 5378147  521063 (TOTALS)
2021-05-19 12:49:57 +02:00
breandan
3d8f666581
Add link to Kotlin parser 2021-05-16 21:38:05 -04:00
Douglas Creager
6abf77a20c web: 0.19.3 2021-05-13 15:14:56 -04:00
Max Brunsfeld
2923c9cb62
Merge pull request #1101 from camdencheek/add-dockerfile
Add link to Dockerfile parser
2021-05-11 08:36:59 -07:00
Camden Cheek
fbe72f2f22
Add link to Dockerfile parser 2021-05-11 08:52:32 -06:00
Max Brunsfeld
335190cc1d
Merge pull request #1089 from tree-sitter/wasm-fix
binding_web: Call correct function to reset parser
2021-05-03 11:47:05 -07:00
Douglas Creager
04c2aa973b binding_web: Call correct function to reset parser 2021-05-03 14:25:57 -04:00
Max Brunsfeld
fe5a29a1c6
Merge pull request #1081 from ahlinc/feat/fail-ci-on-compiler-warnings
feat: Fail CI on compiler warnings
2021-05-01 09:26:44 -07:00
Max Brunsfeld
2083bdcc68
Merge pull request #1084 from alemuller/patch-2
Add Make parser
2021-04-30 12:31:11 -07:00
Alexandre A. Muller
0970b88a9e
Add Make parser
Add make parser and also change Fennel list from `-` to `*` (that created a list inside a list).
2021-04-30 19:06:10 +00:00
Andrew Hlynskyi
9ee8ddb6b6 Fail CI in case of compiler warnings like dead_code 2021-04-30 06:55:00 +03:00
Andrew Hlynskyi
b856f7e1bd Remove unneeded dead_code annotations 2021-04-30 06:55:00 +03:00
Douglas Creager
4e321f34a0
Merge pull request #1075 from tree-sitter/wasm-match-limit
binding_web: Add Query.didExceedMatchLimit
2021-04-28 16:24:06 -04:00
Douglas Creager
b742e88108 Use TRANSFER_BUFFER for did_exceed_match_limit
This bridges the gap between how the C API reports this for a query
cursor, but the wasm API defines the method on a query.  Whenever you
call a query method that might exceed the match limit, we call the C API
function and transfer the result across the wasm boundary, storing the
result in the JavaScript wrapper class.
2021-04-28 15:46:12 -04:00
Douglas Creager
108679ffdc
Merge pull request #1076 from tree-sitter/cli-match-limit-warning
cli: Warn about queries that exceed match limit
2021-04-28 15:37:43 -04:00
Max Brunsfeld
798b32adba
Merge pull request #1079 from camdencheek/add-go-mod
Add go mod grammar
2021-04-28 08:38:34 -07:00
Camden Cheek
a0cec948c5
Add go mod grammar 2021-04-28 08:18:19 -06:00
Max Brunsfeld
c389be5eee
Merge pull request #1074 from markus-oberhumer/fix-const-correctness
cli: Improve const-correctness of the generated parsers.
2021-04-27 09:36:59 -07:00
Douglas Creager
850007718a cli: Warn about queries that exceed match limit 2021-04-27 09:38:43 -04:00
Douglas Creager
e8eb3c5d5a binding_web: Add Query.didExceedMatchLimit
This lets wasm clients check whether a query exceeded its maximum number
of in-progress matches.
2021-04-27 09:21:38 -04:00
Markus F.X.J. Oberhumer
1badd131f9 cli: Improve const-correctness of the generated parsers.
This moves most of the generated tables from the data segment into
the text segment (read-only memory) so that it can be shared between
different processes.

As a bonus side effect we can also remove all casts in the generated parsers.

Before:
  size --totals target/scratch/*.so
      text    data     bss     dec     hex filename
    853623 4684560    2160 5540343  5489f7 (TOTALS)

After:
  size --totals target/scratch/*.so
      text    data     bss     dec     hex filename
   5472086   68616     480 5541182  548d3e (TOTALS)
2021-04-27 09:22:18 +02:00
Max Brunsfeld
b5ec720696
Merge pull request #1071 from ahlinc/feat/rust-binding-additional-error-traits
feat(binding_rust): implement Display and Error traits for TS errors to be convertible
2021-04-22 21:24:07 -07:00
Andrew Hlynskyi
3c0a49289c binding_rust: Improve implementation of fmt::Display for QueryError trait, avoid multiple format!() calls 2021-04-23 06:45:04 +03:00
Max Brunsfeld
347b3eb243
Merge pull request #1069 from ahlinc/fix/package-json-generation
package.json generation improvements
2021-04-22 14:27:36 -07:00
Max Brunsfeld
0bbacebf67
Merge pull request #1068 from ahlinc/fix/cargo-build-warinings
Resolve syntax warnings for cargo build
2021-04-22 13:38:03 -07:00
Max Brunsfeld
f2495aba77
Merge pull request #1072 from ahlinc/feat/separate-nodes-lifetime
feat(binding_rust): separate nodes lifetime from QueryCursor / QueryCaptures. Supersedes #1065
2021-04-22 11:54:23 -07:00
Andrew Hlynskyi
de23c9219a binding_rust: Unbind nodes lifitime from a source for QueryCursor.captures 2021-04-22 21:00:58 +03:00
Andrew Hlynskyi
9c91affe56 binding_rust: Unbind nodes lifitime from a source for QueryCursor.matches 2021-04-22 21:00:58 +03:00
Andrew Hlynskyi
b57266cbb8 test(binding_rust): Use some redundancy to trigger more clear comliler error on the master 2021-04-22 21:00:58 +03:00
Andrew Hlynskyi
2d9a2a1855 test(binding_rust): test query captures/matches lifetime is separate from nodes lifetime 2021-04-22 21:00:58 +03:00
Andrew Hlynskyi
e7b1d84a83 binding_rust: implement Display and Error traits for TS errors to be convertible 2021-04-22 17:50:12 +03:00
Andrew Hlynskyi
7aa538dd97 fix(cli): use dashed language name in generated package.json and Cargo.toml files 2021-04-22 16:29:48 +03:00
Andrew Hlynskyi
9416f975d3 fix(cli): set actual cli version in generated package.json 2021-04-22 16:29:48 +03:00
Andrew Hlynskyi
2094a80022 fix(cli): resolve syntax warnings for cargo build 2021-04-22 16:23:00 +03:00
Max Brunsfeld
ca6e8d9341
Merge pull request #1053 from an-kumar/patch-1
Update generated Cargo.toml's tree-sitter dependency
2021-04-09 11:31:07 -07:00
an-kumar
aabe6100d0
Update generated Cargo.toml's tree-sitter dependency
tree-sitter 0.19.0 bumped the language version from 12 to 13. `npm install tree-sitter-cli` gets a recent version of tree-sitter, which generates languages with language version 13. However, the Cargo.toml generated from `tree-sitter generate` still has a an old tree-sitter as a dependency. This causes the rust bindings to not work out of the box, as the tree-sitter library expects language version 12.

It would be nice to add a test for this in CI.  `tree-sitter generate` already creates a test for the rust binding, and that test fails out of the box due to the language mismatch.
2021-04-09 10:59:51 -07:00
Max Brunsfeld
1ede51121b
Merge pull request #1044 from aminya/windows-build-wasm
Fix build-wasm on Windows
2021-04-05 12:55:44 -07:00
Amin Yahyaabadi
90c9a3a2f8 Refactor get_emcc_path and use PathBuf 2021-04-04 21:16:53 -05:00
Amin Yahyaabadi
919eab023f Fix build-wasm on Windows 2021-04-04 19:07:16 -05:00
Douglas Creager
234bd79591 Update tree-sitter-{highlight,tags} READMEs
We now have an easier way to get at the language-specific configuration
in Rust, since we publish each language grammar as a crate with useful
accessor functions and globals.
2021-03-31 09:56:24 -04:00