Commit graph

3590 commits

Author SHA1 Message Date
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
Max Brunsfeld
76862e281b
Merge pull request #1025 from ganezdragon/add-perl-as-available-parser
adding perl parser under development section
2021-03-28 09:11:37 -07:00
ganezdragon
91bd731094 adding perl parser under development section 2021-03-28 18:35:11 +05:30
Max Brunsfeld
c3eb5daa31 Include has_preceding_inherited_fields in Item's hash impl 2021-03-27 10:08:24 -07:00
Max Brunsfeld
72143b17ff Fix handling of queries with field names at the roots of patterns
Fixes #1018
2021-03-27 09:36:13 -07:00
Patrick Thomson
6e8b5e7643
Merge pull request #1012 from Sjord/fix-lanugage-typo
Fix typo: lanugage -> language
2021-03-23 12:32:16 -04:00
Sjoerd Langkemper
103d37adc4 Fix typo: lanugage -> language 2021-03-23 16:42:07 +01:00
Max Brunsfeld
89e1157a29 Fix handling of repetitions in query analysis
Fixes #1007
2021-03-19 11:00:31 -07:00
Max Brunsfeld
56c7c6b39d Add zenodo citation badge to readme 2021-03-18 12:16:03 -07:00
Max Brunsfeld
810d10fa26 0.19.4 2021-03-18 10:36:05 -07:00
Max Brunsfeld
5f313689f0 rust: 0.19.4 2021-03-18 10:36:05 -07:00
Max Brunsfeld
2a99108171 web: 0.19.2 2021-03-18 10:36:05 -07:00
Max Brunsfeld
a440e11197
Merge pull request #996 from ahlinc/fix/test-precondition
fix: assertion in highlight::tests::test_parse_style test
2021-03-18 10:25:02 -07:00
Max Brunsfeld
e94b208da2
Merge pull request #999 from BonaBeavis/patch-2
sparql and turtle parsers are stable
2021-03-17 15:42:11 -07:00
BonaBeavis
f96612c7cd
sparql and turtle parsers are stable 2021-03-17 23:11:11 +01:00
Max Brunsfeld
beaa02331e
Merge pull request #998 from tree-sitter/node-kind-fix
Fix check in ts_language_symbol_type (#997)
2021-03-17 11:49:01 -07:00
Patrick Thomson
3e4cda8353 Fix check in ts_language_symbol_type (#997)
As per Max's advice, this function should only return
`TSSymbolTypeRegular` when the metadata is both visible and named.
2021-03-17 14:12:58 -04:00
Max Brunsfeld
d14c3de32e
Merge pull request #975 from ahlinc/fix/query-start-position-zeroing
fix: don't zeroing provided start position by the end zero position
2021-03-17 10:55:32 -07:00
Andrew Hlynskyi
192f51324e Added more test for byte and point ranges 2021-03-17 19:11:20 +02:00
Andrew Hlynskyi
1769d1459d fix: don't zeroing provided start position by the end zero position 2021-03-17 19:06:52 +02:00
Andrew Hlynskyi
148680b3b9 fix: assertion in highlight::tests::test_parse_style test 2021-03-17 15:52:21 +02:00
Max Brunsfeld
f3910c649e
Merge pull request #989 from jmbockhorst/fix-descendants-of-type
Web bindings: fix descendantsOfType memory allocation
2021-03-13 21:55:12 -08:00
Jon Bockhorst
1e9481dc48 Web bindings: fix descendantsOfType memory allocation 2021-03-13 22:28:10 -06:00
Max Brunsfeld
ec8520ca42
Merge pull request #986 from PBug90/test-command-help
Test command help updates
2021-03-13 11:10:24 -08:00
pbug90
9d04efda94 update wording 2021-03-13 19:55:04 +01:00
pbug90
9a833d165e update test command filter help 2021-03-13 19:53:10 +01:00
pbug90
858160172f update test command help outputs 2021-03-13 19:45:55 +01:00
Max Brunsfeld
168bef55f2
Merge pull request #985 from jonhue/fix-prec-types-in-dsl
fix type of prec in dsl
2021-03-13 08:27:36 -08:00
Jonas Hübotter
5e9c3c69e2 fix type of prec in dsl 2021-03-13 13:10:12 +01:00
Max Brunsfeld
48fa4bdb00 rust: 0.19.3 2021-03-12 15:21:47 -08:00
Max Brunsfeld
a7ae7767b4 Add docs for negated field patterns 2021-03-12 15:12:24 -08:00