Max Brunsfeld
561dfe3a2d
Merge pull request #1394 from tree-sitter/fix/query-predicates-with-alternations
...
fix(cli): Panic on queries containing alternation with predicates
2021-09-24 08:56:23 -07:00
Andrew Hlynskyi
d973527964
binding(rust): Mark set_cancellation_flag self as mutable
2021-09-21 23:03:50 +03:00
Andrew Hlynskyi
79b2bf1c30
fix(wasm): Fix predicates in alternations, resolves #1392
2021-09-21 21:13:41 +03:00
Andrew Hlynskyi
b324d0802a
fix(cli): Panic on queries containing alternation with predicates
...
`QuearyMatch::satisfies_text_predicates()` was changed to pass
captures that don't relate to a checked predicate. This allows
predicates in inner alternations for queries.
Refs #1392
2021-09-21 19:51:30 +03:00
Andrew Hlynskyi
ae12ff81b5
feat(rust): Add an id() method for QueryMatch
...
Refs #1372
2021-09-14 19:08:29 +03:00
Max Brunsfeld
22a5cfbe10
Assign ids to query matches only when the matches are returned
...
Refs #1372
2021-09-13 12:39:48 -07:00
Max Brunsfeld
5c2ebf093b
Include memmove symbol in wasm build
2021-09-10 15:21:55 -07:00
Alon Hershenhorn
b239583510
Fix typo in API documentation
...
Fix small typo in ts_tree_cursor_current_field_id documentation.
2021-09-10 12:28:23 -07:00
Andrew Hlynskyi
52e6c900c3
fix(lib): fix segfault on ts_query_new with incompatible grammar version, close #1318
2021-09-03 14:24:18 +03:00
Max Brunsfeld
0e26fbe5e6
Merge pull request #1367 from jrieken/moduleInit
...
Allow to pass Module object to init-function
2021-08-30 09:32:43 -07:00
Max Brunsfeld
eeda44d837
Merge pull request #1368 from jrieken/dtsTweaks
...
Fixes and additions to tree-sitter-web.d.ts
2021-08-30 09:17:53 -07:00
Johannes Rieken
3e9874df7f
Don't confuse terser with object spread
2021-08-30 14:56:28 +02:00
Johannes Rieken
e7a8e73bbf
fixes and additions to tree-sitter-web.d.ts
2021-08-30 14:47:47 +02:00
Johannes Rieken
12d727fd49
mix init options in the Module-global
2021-08-30 14:16:41 +02:00
Andrew Hlynskyi
f15700c6bd
chore(web): Add the LICENSE file to the web-tree-sitter npm package
2021-08-22 03:13:46 +03:00
Andrew Hlynskyi
7f538170bf
fix(parser): count rows in the debug log from 0
2021-07-15 11:47:14 +03:00
Max Brunsfeld
190fee3625
Merge pull request #1177 from forbisc/master
...
update set_included_ranges to modify extent if the current position is at the very beginning of the range.
2021-06-30 08:38:59 -07:00
Max Brunsfeld
be69777350
libs: 0.20.0
2021-06-29 17:18:22 -07:00
Andrew Hlynskyi
a286f831c7
Bump Emscripten version to 2.0.24
2021-06-30 01:06:33 +03:00
Cameron Forbis
9182ebef86
update set_included_ranges to modify extent if the current position is at the very beginning of the included range
2021-06-17 16:42:25 -07:00
Max Brunsfeld
ad8bd3c3f5
Merge pull request #1120 from claudi/cast-printed-pointers
...
Fix: cast pointers to `void *` when printing
2021-06-07 09:09:54 -07:00
Max Brunsfeld
f3ea60e23f
Merge branch 'master' into query-cursor-api
2021-06-02 11:51:26 -07:00
Douglas Creager
cc20708a33
query: Minor cleanups
2021-06-02 14:16:04 -04:00
Douglas Creager
47f1af818a
query: Remove bits.h
2021-06-02 14:14:57 -04:00
Douglas Creager
ad3907c2a6
wasm: Add matchLimit option to query methods
...
This exposes the new configurable match limits for query cursors.
2021-06-02 13:51:00 -04:00
Douglas Creager
1f6eac555c
query: Use uint32_t for capture list IDs
2021-06-02 13:19:52 -04:00
Max Brunsfeld
8416894923
Use std::iter::Once in impl TextProvider for [u8]
...
Co-Authored-By: Douglas Creager <dcreager@dcreager.net>
2021-06-02 09:15:04 -07:00
Douglas Creager
cd96552448
query: Allow configurable match limit
...
The default is now a whopping 64K matches, which "should be enough for
everyone". You can use the new `ts_query_cursor_set_match_limit`
function to set this to a lower limit, such as the previous default of
32.
2021-06-02 11:30:55 -04:00
Max Brunsfeld
d72771a19f
Make ::set_{byte,point}_range methods take a Range
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 14:21:11 -07:00
Max Brunsfeld
7f4eb9a222
Provide ::set_{byte,point}_range on both query iterators
2021-05-28 14:07:54 -07:00
Max Brunsfeld
97dfee6325
Add QueryMatch::nodes_for_capture_index
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 12:38:30 -07:00
Max Brunsfeld
dab11134c2
Add Query::capture_index_for_name method
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 12:27:50 -07:00
Max Brunsfeld
851f55afce
Report non-rooted matches that intersect cursor's range restriction
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 11:58:38 -07:00
Max Brunsfeld
919e9745a6
Add ts_tree_cursor_goto_first_child_for_point function
...
This function (and the similar `ts_tree_cursor_goto_first_child_for_byte`)
allows you to efficiently seek the tree cursor to a given position,
exploiting the tree's internal balancing, without having to visit
all of the preceding siblings of each node.
2021-05-27 12:30:19 -07:00
Max Brunsfeld
036aceed57
In script/generate-bindings, add flags for latest bindgen
2021-05-25 18:02:39 -07:00
Max Brunsfeld
fda35894d4
Stop matching new patterns past the end of QueryCursor's range
...
This restores the original signatures of the `set_byte_range` and
`set_point_range` functions. Now, the QueryCursor will properly report
matches that intersect, but are not fully contained by its range.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-25 18:02:35 -07:00
Max Brunsfeld
f597cc6a75
Preserve matches that contain the QueryCursor's start byte
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-05-25 13:06:24 -07:00
Max Brunsfeld
a61f25bc58
Add APIs for advancing a QueryCursor to an arbitrary position
2021-05-24 21:07:59 -07:00
Douglas Creager
78010722a4
query: Allow unlimited pending matches
...
Well, not completely unlimited — we're still using a 16-bit counter to
keep track of them. But we longer have a static maximum of 32 pending
matches when executing a query.
2021-05-24 11:02:58 -04:00
Max Brunsfeld
8c3d1466ec
Allow QueryCursor's text callback to return an iterator
2021-05-23 21:05:26 -07:00
Max Brunsfeld
0e445c47fa
rust: Parser and QueryCursor are Sync
...
These objects are not generally intended to be shared betwen threads,
but they meet the Rust definition of Sync: all of their methods are
that take a shared reference to `self` are safe to call from multiple
threads simultaneously. In other words, there is no interior
mutability.
2021-05-21 21:14:24 -07:00
Claudi Lleyda Moltó
8e4509e47b
Fix: cast pointers to void * when printing
...
To avoid undefined behaviour, pointers should be cast to `void *` when
printed with `%p`.
2021-05-21 12:36:58 +02:00
Niranjan Hasabnis
c31acb8fec
Changing API name; Adding unit test and Rust bindings
2021-05-21 01:50:10 +00:00
Niranjan Hasabnis
bd06b1a8b3
Merge branch 'nhasabni/ts_node_child_field_name' of https://github.com/nhasabni/tree-sitter into nhasabni/ts_node_child_field_name
2021-05-20 23:37:03 +00:00
Niranjan Hasabnis
e2b8130f62
Merge branch 'tree-sitter:master' into nhasabni/ts_node_child_field_name
2021-05-20 16:35:52 -07:00
Niranjan Hasabnis
c0f7022165
Function rename
2021-05-20 23:29:25 +00:00
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
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