Commit graph

945 commits

Author SHA1 Message Date
Christian Clason
c3dd66df0e build(deps): bump wasmtime to v23.0.2 2024-08-16 14:02:56 +02:00
Ryan Patterson
779566f588
Reset language when resetting wasm store (#3495)
* Reset language when resetting wasm store

* test behavior of language copying
2024-07-31 10:30:58 -07:00
Boris Verkhovskiy
cd3e561224
build(wasm): don't minify JS (#3380) 2024-07-29 10:00:02 +03:00
ObserverOfTime
2512f3ab17 docs: document rust library features 2024-07-28 11:34:26 +03:00
DragonBillow
d13d7235d2 feat(lib): support no_std 2024-07-28 11:34:26 +03:00
ibrahim Sağıroğlu
76456919ae
docs: fix tree cursor documentation (#3324)
- ts_tree_cursor_current_depth
- ts_tree_cursor_reset
2024-07-28 10:36:06 +03:00
Amaan Qureshi
25c7189180 feat(lib): add ts_query_end_byte_for_pattern 2024-07-07 20:29:09 -04:00
Quentin LE DILAVREC
9610a84600
fix(lib): restrict pattern_map optimization when a wildcard step has an immediate first child
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-07-05 03:35:24 -04:00
Davis Vaughan
218a071d33 Swap sprintf() for snprintf() 2024-06-24 09:56:24 -04:00
Piotr Osiewicz
3c3699ba90
perf: hoist out common subexpressions in satisfies_text_predicates
This commit stores the result of text predicates evaluation in a separate variable to ensure that they're computed just once. As is, it is possible for e.g. #match predicates to match node against a regex twice.
2024-06-03 14:25:30 +02:00
Amaan Qureshi
6304009209
fix(wasm): update test 2024-06-03 12:42:25 +02:00
Amaan Qureshi
7f4a57817d build(deps): bump wasmtime to v21 2024-05-29 18:57:26 -04:00
Max Brunsfeld
38137c71b2 feat!: introduce tree-sitter-language crate for grammar crates to depend on
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-05-24 21:54:07 -04:00
Amaan Qureshi
ae35a36747 fix(lib): a null clock must have tv_nsec be 0 as well 2024-05-19 02:19:37 -04:00
Paolo Tranquilli
d35e40185a
fix(rust): fetch CARGO_MANIFEST_DIR at runtime in build script
The `CARGO_MANIFEST_DIR` environment variable should be accessed by
`build.rs` at run time rather than compile time. This was for example
causing issues when importing `tree-sitter` via
[`rules_rust`](https://github.com/bazelbuild/rules_rust) in bazel,
where compilation and running happen in separate environments.
2024-05-13 10:09:58 -04:00
Amaan Qureshi
b40f342067
0.22.6 2024-05-05 16:47:18 -04:00
Amaan Qureshi
4c083252ec fix(lib): advance the lookahead end byte by 4 when there's an invalid code point
This helps in the case where an edit was made in the middle of a code
point, but bytes 1-3 are valid, thus we could advance by at most 4 bytes
2024-04-30 20:55:43 -04:00
Amaan Qureshi
61d0395543 fix(lib): do not return field names for extras 2024-04-30 19:23:11 -04:00
Max Brunsfeld
37a919184f Position serialization buffer after language statics in wasm linear memory 2024-04-25 14:21:28 -07:00
Max Brunsfeld
78efd96bbe Crash earlier if native external scanner overflows serialization buffer 2024-04-25 13:55:47 -07:00
Max Brunsfeld
e9fd4ccf0c Guard against serialization buffer overflows from wasm languages 2024-04-25 13:51:05 -07:00
Max Brunsfeld
d7a23cf017 fix: Correctly load field data from wasm languages
Previously, if the last production id in a language did not have
a unique set of fields, the field maps weren't loaded correctly
from wasm.

Co-authored-by: Marshall <marshall@zed.dev>
2024-04-24 16:29:44 -07:00
vanaigr
90e0e28b95
feat: reverse iteration through node parents (#3214) 2024-04-23 15:19:57 +01:00
Liam Rosenfeld
0f125e2d09
fix(rust): use unix + wasi cfg instead of not windows for fd 2024-04-23 10:13:38 -04:00
Jisuk Byun
4cd23ff6b0
fix(rust): update README example 2024-04-18 13:25:42 -04:00
Adrien Friggeri
01bf431261
fix(wasm): correct childrenFromFieldXXX method signatures
These do not expect a `cursor` parameter
2024-04-16 13:48:53 -04:00
Max Brunsfeld
cdd4688860 0.22.5 2024-04-14 10:17:04 -07:00
Mark McCulloh
a7a47d561d
fix(rust): compilation on wasm32-wasi 2024-04-13 18:30:41 -04:00
Max Brunsfeld
285257998c 0.22.4 2024-04-12 17:03:02 -07:00
Max Brunsfeld
a3d338781b 0.22.3 2024-04-12 15:10:49 -07:00
Max Brunsfeld
7ec40b0ab4 Implement single-char state transitions using a static array and for loop
This reduces compile time, compared to generating many individual if statements.
2024-04-12 14:40:11 -07:00
Max Brunsfeld
3498498449 Merge branch 'master' into simpler-large-char-set-code 2024-04-12 10:03:46 -07:00
Amaan Qureshi
96d18408a3 refactor(js): misc fixes & tidying 2024-04-11 22:35:43 -04:00
Amaan Qureshi
abc7910381 refactor(rust): misc fixes & tidying 2024-04-11 22:35:43 -04:00
Amaan Qureshi
5825e24d56 style: wrap comments 2024-04-11 22:35:43 -04:00
Amaan Qureshi
b35efa8f33 style: format imports 2024-04-11 22:35:43 -04:00
Max Brunsfeld
be6e6d3708 Merge branch 'master' into simpler-large-char-set-code 2024-04-11 16:03:20 -07:00
ObserverOfTime
818cd8c291
refactor(parser): make REDUCE macro non-variadic 2024-04-11 20:47:08 +03:00
Will Lillis
cbcb51b857
fix: tie the lifetime of the cursor to the query in QueryCursor::captures() 2024-04-09 12:19:06 -04:00
Amaan Qureshi
c1a63019a4 chore: update tests 2024-04-08 17:56:05 -04:00
Torsten Schmits
cdd00defdb
fix(lib): use correct format specifier in log message 2024-04-04 14:51:15 -04:00
WillLillis
a7078a1561 fix: Add lifetime to mactches function 2024-04-03 22:06:19 -04:00
ObserverOfTime
78b6067a5d fix(parser): fix variadic macro 2024-04-02 03:18:05 -04:00
Max Brunsfeld
39be6972fe Use static arrays and a fixed binary search for large char set checks 2024-03-29 23:00:48 -07:00
Max Brunsfeld
0fc92c9a7d Add strncat to wasm stdlib
Co-authored-by: Marshall <marshall@zed.dev>
2024-03-25 09:51:54 -07:00
Max Brunsfeld
b7fcf9878e Upgrade wasmtime 2024-03-20 18:23:44 -07:00
Max Brunsfeld
8945e3a111 Fix sorting of wasm stdlib symbols 2024-03-20 18:23:44 -07:00
Amaan Qureshi
09d2b23a64 fix(lib): account for the root node of a tree cursor being an alias 2024-03-20 19:23:08 -04:00
Amaan Qureshi
24a68697ac fix(lib): properly account for aliased root nodes and root nodes with
children in `ts_subtree_string`
2024-03-20 19:23:08 -04:00
Amaan Qureshi
ab485da756 fix(lib): do not consider childless nodes for ts_node_parent 2024-03-20 19:23:08 -04:00