Commit graph

145 commits

Author SHA1 Message Date
Max Brunsfeld
d47713ee4a Integrate WASM compilation into the CLI's Loader 2022-11-15 17:14:33 -08:00
Max Brunsfeld
3f1a7f9cd4 Start work on ability to load wasm languages from native lib, via wasmtime 2022-11-15 17:14:33 -08:00
Max Brunsfeld
b268e412ad 0.20.7 2022-09-02 15:00:47 -07:00
Max Brunsfeld
2be51abcd8 Bump library versions 2022-09-02 15:00:09 -07:00
Max Brunsfeld
01df16ca9f lib: 0.20.8 2022-06-27 15:07:40 -07:00
Max Brunsfeld
db91399ea7 lib: 0.20.7 2022-06-22 16:03:21 -07:00
Max Brunsfeld
ccd6bf554d 0.20.6 2022-03-02 20:50:52 -08:00
Max Brunsfeld
1b2e90f647 libs: 0.20.6 2022-03-02 20:50:29 -08:00
Max Brunsfeld
4b93326898 Don't generate primary states array if it will be unused due to abi version setting 2022-03-02 14:57:59 -08:00
Max Brunsfeld
09d08e8f8b 0.20.5 2022-03-02 14:43:53 -08:00
Max Brunsfeld
fcbef45899 libs: 0.20.5 2022-03-02 14:43:16 -08:00
Max Brunsfeld
9866674cf8
Merge pull request #1660 from alex-pinkus/expanded-regex-support
Expand regex support to include emojis and binary ops
2022-02-24 17:14:23 -08:00
Alex Pinkus
8fadf18655 Expand regex support to include emojis and binary ops
The `Emoji` property alias is already present, but the actual property
is not available since it lives in a new file. This adds that file to
the `generate-unicode-categories-json`.

The `emoji-data` file follows the same format as the ones we already
consume in `generate-unicode-categories-json`, so adding emoji support
is fairly easy. his, grammars would need to hard-code a set of
unicode ranges in their own regex. The Javascript library `emoji-regex`
cannot be used because of #451.

For unclear reasons, the characters #, *, and 0-9 are marked as
`Emoji=Yes` by `emoji-data.txt`. Because of this, a grammar that wishes
to use emojis is likely to want to exclude those characters. For that
reason, this change also adds support for binary operations in regexes,
e.g. `[\p{Emoji}&&[^#*0-9]]`.

Lastly (and perhaps controversially), this change introduces new
variables available at grammar compile time, for the major, minor, and
patch versions of the tree-sitter CLI used to compile the grammar. This
will allow grammars to conditionally adopt these new regex features
while remaining backward compatible with older versions of the CLI.
Without this part of the change, grammar authors who do not precompile
and check-in their `grammar.json` would need to wait for downstream
systems to adopt a newer tree-sitter CLI version before they could begin
to use these features.
2022-02-19 11:41:36 -08:00
Max Brunsfeld
5ef4ef4e2e lib: 0.20.4 2022-02-04 13:13:21 -08:00
Max Brunsfeld
714bfd47a7 0.20.4 2022-01-23 10:46:04 -08:00
Max Brunsfeld
3ff5c19403 0.20.3 2022-01-21 16:36:45 -08:00
Max Brunsfeld
fab8540508 libs: 0.20.3 2022-01-21 16:35:37 -08:00
Max Brunsfeld
4ee52ee99e 0.20.2 2021-12-31 17:23:08 -08:00
Max Brunsfeld
f010781efa lib: 0.20.2 2021-12-30 16:35:21 -08:00
Max Brunsfeld
622359b400 Simplify allocation-recording in test suite using new ts_set_allocator API 2021-12-30 16:09:07 -08:00
Max Brunsfeld
775ec76908 Update loader dependency in cli 2021-11-21 13:56:22 -08:00
Max Brunsfeld
86b408412c Use serde's derive feature everywhere 2021-11-21 13:39:30 -08:00
Max Brunsfeld
c432739a65 tags: 0.20.1 2021-11-21 13:31:01 -08:00
Max Brunsfeld
062421dece 0.20.1 2021-11-21 12:33:27 -08:00
Max Brunsfeld
42360fc003 Bump library versions to 0.20.1 2021-11-21 12:33:12 -08:00
Max Brunsfeld
f69c4861c3 Add a randomized test for query matching 2021-11-21 11:29:36 -08:00
Amin Yahyaabadi
8a5620ce15 Use serde's derive feature 2021-10-05 02:38:18 -05:00
Paul Gey
f34c13d2a7 Update smallbitvec dependency 2021-08-08 21:45:43 +02:00
Paul Gey
cf69a2c94c Use IndexMap and FxHash for some hot hash maps 2021-08-08 21:45:43 +02:00
Max Brunsfeld
e85a279cf2 0.20.0 2021-06-29 17:18:39 -07:00
Max Brunsfeld
be69777350 libs: 0.20.0 2021-06-29 17:18:22 -07:00
Andrew Hlynskyi
f22d62393b fix(cli): actual Rust binding version in generated Cargo.toml 2021-06-30 00:36:11 +03:00
Douglas Creager
e841fcfa1b cli: Extract CLI configuration into separate crate
This patch adds the `tree-sitter-config` crate, which manages
tree-sitter's configuration file.  This new setup allows different
components to define their own serializable configuration types, instead
of having to create a single monolithic configuration type.  But the
configuration itself is still stored in a single JSON file.

Before, the default location for the configuration file was
`~/.tree-sitter/config.json`.  This patch updates the default location
to follow the XDG Base Directory spec (or other relevant platform-
specific spec).  So on Linux, for instance, the new default location is
`~/.config/tree-sitter/config.json`.  We will look in the new location
_first_, and fall back on reading from the legacy location if we can't
find anything.
2021-06-10 10:21:22 -04:00
Douglas Creager
66c30648c2 rust: Extract runtime language detection into separate crate
This patch adds a new `tree-sitter-loader` crate, which holds the CLI's
logic for finding and building local grammar definitions at runtime.
This allows other command-line tools to use this logic too!
2021-06-09 17:42:30 -04:00
Douglas Creager
d2d01e77e3 cli: Use anyhow and thiserror for errors
This patch updates the CLI to use anyhow and thiserror for error
management.  The main feature that our custom `Error` type was providing
was a _list_ of messages, which would allow us to annotate "lower-level"
errors with more contextual information.  This is exactly what's
provided by anyhow's `Context` trait.

(This is setup work for a future PR that will pull the `config` and
`loader` modules out into separate crates; by using `anyhow` we wouldn't
have to deal with a circular dependency between with the new crates.)
2021-06-09 16:17:23 -04:00
Max Brunsfeld
8d8690538e 0.19.5 2021-05-20 15:02:46 -07:00
Max Brunsfeld
5664b77535 rust: 0.19.5 2021-05-20 14:29:25 -07:00
Amin Yahyaabadi
919eab023f Fix build-wasm on Windows 2021-04-04 19:07:16 -05: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
48fa4bdb00 rust: 0.19.3 2021-03-12 15:21:47 -08:00
Max Brunsfeld
24785cdb39 0.19.3 2021-03-08 16:36:59 -08:00
Max Brunsfeld
841e160898 rust libs: 0.19.2 2021-03-08 10:03:45 -08:00
Max Brunsfeld
d037c4914d 0.19.2 2021-03-05 15:35:51 -08:00
Max Brunsfeld
0818892a1a libs: 0.19.1 2021-03-05 15:31:48 -08:00
Max Brunsfeld
d6254e35c3 0.19.1 2021-03-03 13:35:38 -08:00
Max Brunsfeld
22fb88e89d Bump library versions to 0.19 2021-03-01 14:46:43 -08:00
Max Brunsfeld
5f1bb20c49 0.19.0 2021-03-01 12:19:41 -08:00
hvithrafn
05f79f0f90 Update dependencies; fix breakage 2021-02-26 10:55:20 -07:00
Patrick Thomson
44010d69ea Walk query files recursively in tree-sitter test.
We were only walking one level of depth into the `queries/` folder
during invocations of `test`, which made us attempt to open folders
rather than recurse into them.

We have to pull in the `walkdir` crate, which is required for
cross-platform walking of directories.

Fixes #938.
2021-02-25 10:24:54 -05:00