Commit graph

440 commits

Author SHA1 Message Date
Max Brunsfeld
4a8e4b1963 Allow wasm languages to be deleted 2023-12-27 15:00:16 -08:00
Max Brunsfeld
da16cb1459 Introduce language ref-count management C APIs, remove Copy impl for Language in Rust 2023-12-27 14:59:16 -08:00
Max Brunsfeld
68ba9a4d66 Grow memory dynamically as-needed when loading wasm language modules 2023-12-03 12:12:47 -08:00
Max Brunsfeld
f2285b43ea Fix crash when failing to instantiate wasm stdlib module 2023-12-03 11:42:03 -08:00
Max Brunsfeld
09b522ece2 Fix another bug in subtree_compare
When subtrees differ, exit loop before pushing children to the stack.
2023-11-30 11:10:33 -08:00
Max Brunsfeld
034f0d0280
Merge pull request #1864 from tree-sitter/wasm-language
Add optional WASM feature to the native library, allowing it to run wasm-compiled parsers via wasmtime
2023-11-28 12:08:47 -08:00
Max Brunsfeld
13dd76e444 Return an informative error on failing to construct a WasmStore 2023-11-27 17:48:29 -08:00
Andrew Hlynskyi
0d26309c41
Revert "chore(lib): fix fields naming in QueryPattern to singular" 2023-11-28 02:30:01 +02:00
Max Brunsfeld
5e2456c2f2 Avoid using recursion for ts_subtree_compare
This can lead to stack overflow crashes.
2023-11-27 11:35:33 -08:00
Max Brunsfeld
6fd7a1e44e Return informative error when load_language fails 2023-11-26 12:15:05 -08:00
Max Brunsfeld
e9289d3b30 Fix error when wrong language name is passed to load_language 2023-11-24 20:25:28 -08:00
Max Brunsfeld
b59716600a Add a test that loads multiple languages in a wasm store 2023-11-24 20:03:54 -08:00
Max Brunsfeld
359317f876 Determine sizes of static wasm arrays from subsequent static pointers 2023-11-24 11:32:24 -08:00
Max Brunsfeld
97800e0ec8 Advance wasm store's mem + table offsets when adding a language 2023-11-19 12:26:59 -08:00
Amaan Qureshi
0ff28346be
Merge pull request #2714 from MrPrezident/test_point_range_captures_fix
fix "test_point_range_captures not working"
2023-11-12 21:09:09 -08:00
MrPrezident
3c4957e940 fix "test_point_range_captures not working"
Fix for https://github.com/tree-sitter/py-tree-sitter/issues/105
2023-11-12 20:58:51 -06:00
Max Brunsfeld
098969db08 Fix windows compile errors in wasm.c 2023-11-04 12:26:00 -07:00
Max Brunsfeld
b26eff13e2 Remove code duplication in wasm module instantiation, add stdlib symbols 2023-10-31 15:58:56 -07:00
Max Brunsfeld
0743edd162 Include two more std::string functions in wasm stdlib 2023-10-27 21:54:23 +01:00
Max Brunsfeld
b23ef57259 Update wasmtime headers, use latest wasmtime C APIs 2023-10-27 21:30:13 +01:00
Max Brunsfeld
ae2f60d907 Fix loading of wasm languages with fields but no aliases 2023-10-27 21:29:23 +01:00
Max Brunsfeld
81a1a1733d Fix C compile warnings in wasm.c 2023-10-27 12:16:05 +01:00
Max Brunsfeld
f4e2f68f14 Merge branch 'master' into wasm-language 2023-10-27 12:11:43 +01:00
Daumantas Kavolis
143ed959c9
Use single if block 2023-10-25 10:47:55 +03:00
Daumantas Kavolis
e265929f90
Fix goto_previous_sibling with padded first children 2023-10-25 10:19:03 +03:00
Andrew Hlynskyi
46965770fc fix(lib): segmentation fault in ts_node_parse_state 2023-09-12 02:35:22 +03:00
Andrew Hlynskyi
67a5dbdd93 fix: dealloc calls on zero pointers 2023-09-03 06:53:18 +03:00
Andrew Hlynskyi
055c329a69 chore(lib): fix fields naming in QueryPattern to singular 2023-09-02 21:08:54 +03:00
Amaan Qureshi
a4ea4737ac fix: do not increment current_included_range_index past included_range_count in __do_advance 2023-08-27 14:16:18 +03:00
Amaan Qureshi
5c7098dd56
fix(query): debug print uses wrong variable 2023-08-22 19:22:31 -04:00
Max Brunsfeld
9564e1706d Fix error recovery regression due to stack node_count change 2023-08-17 17:21:31 -07:00
Andrew Hlynskyi
f9e8802234 Use the same flags in lib's build.rs as in Makefile 2023-08-17 16:27:52 +03:00
Amaan Qureshi
ec17f60de5
fix: use SEQ_CST in atomic inc/dec 2023-08-13 12:27:00 -04:00
Amaan Qureshi
7a6c0f23fa fix: musl compilation 2023-08-13 02:02:40 -04:00
Andrew Hlynskyi
26c3ae7b98 Rename: ts_lookahead_iterator_advance -> ts_lookahead_iterator_next 2023-08-09 14:40:29 +03:00
Amaan Qureshi
d710dc9c89 fix: ensure function signatures in the API consistently show parameter names 2023-08-03 22:17:53 +01:00
Amaan Qureshi
05a4f9f3e3
Merge pull request #1411 from aminya/c-warnings
Fix compiling C library with Clang on Windows
2023-08-03 13:39:52 -04:00
Samuel Moelius
41ec8b4166 Partially revert d4d5e29 2023-08-03 11:41:50 +03:00
Andrew Hlynskyi
1ac134a97d Apply ts_node_is_error in Rust binding 2023-08-02 00:27:19 +03:00
Daumantas Kavolis
8c789bf7d5 After review 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
4d6a30a69e Need to check that left row is also non-zero so that columns are not subtracted twice 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
ec90c215ae Add tests for bidirectional cursor 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
672d38803e Add iteration over names 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
1f52f2f1dc Symbols without aliases should be used for lookahead 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
7267384970 Use step directly 2023-08-02 00:02:33 +03:00
Daumantas Kavolis
c47e217e73 API extensions 2023-08-02 00:02:33 +03:00
Amaan Qureshi
7d4b0110a9
Merge pull request #2429 from the-mikedavis/md-prev-child-fix
ts_node__prev_child: Reset earlier node when backtracking
2023-07-25 16:22:36 -04:00
Michael Davis
5a8a4b0dcf
ts_node__prev_child: Reset earlier node when backtracking
`earlier_node` must be reset when backtracking up the tree or else
`ts_node__prev_child` may loop infinitely on a subtree which contains
zero-width tokens.
2023-07-24 15:08:55 -05:00
Amaan Qureshi
269a9a8ecf
fix!: use abort instead of exit(1) when allocations fail 2023-07-24 02:28:09 -04:00
Amaan Qureshi
13f6ec2b0c
fix: rename shadowed variables from -Wshadow warnings and apply some useful clang-tidy warnings 2023-07-19 18:12:26 -04:00