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
047d33eecf
Remove bad logic for detecting later siblings with the same field
...
Co-authored-by: Douglas Creager <dcreager@dcreager.net>
2021-03-05 14:50:16 -08:00
Aron Griffis
e13581b041
Fix build with GCC 11
...
It seems redundant to array_init() when the structure is zeroed already
in the static assignment. But probably the fact that this code juggles
between TSTreeCursor and TreeCursor, without using a union, leaves the
compiler unable to tell that it's been initialized.
Fixes https://github.com/tree-sitter/tree-sitter/issues/853
2020-12-22 15:19:35 -05:00
Max Brunsfeld
99cd283e39
query: Fix detection of repeated field names
...
Fixes #790
2020-11-02 14:07:39 -08:00
Max Brunsfeld
d533d1f076
Allocate parent nodes together with their child array
2020-10-23 12:15:44 -07:00
Max Brunsfeld
857a9ed07b
query: Handle captured wildcard nodes at the root of patterns
2020-10-08 12:34:08 -07:00
Max Brunsfeld
a544200a6c
Simplify query code for matching supertypes
2020-09-23 11:55:03 -07:00
Max Brunsfeld
b5a9adb555
Allow queries to match on supertypes
...
Co-authored-by: Ayman Nadeem <aymannadeem@github.com>
2020-09-21 12:34:48 -07:00
Max Brunsfeld
36a8821f3e
Fix behavior of the last child operator in tree queries
2020-09-02 12:10:04 -07:00
Max Brunsfeld
6a46dff89a
Add ts_language_alias_at helper function
2020-06-25 15:06:26 -07:00
Max Brunsfeld
a6b6a681ec
Fix a bug that prevented early termination of query matches
2019-09-18 16:13:10 -07:00
Max Brunsfeld
186b08381c
Terminate failed query matches before descending whenever possible
...
When iterating over captures, this prevents reasonable queries from
forcing the tree cursor to buffer matches unnecessarily.
2019-09-18 11:37:49 -07:00
Max Brunsfeld
fe7c74e7aa
Start work on an API for querying trees
2019-09-10 20:53:57 -07:00
Max Brunsfeld
30e73505e1
Fix handling of extra tokens in ts_tree_cursor_current_field_id
2019-09-04 09:04:31 -07:00
Andrey Zaytsev
7f2233ddaf
Ts tree cursor copy ( #363 )
...
* add ts_tree_cursor_copy fn
* indentation
2019-06-16 10:52:37 -07:00
Max Brunsfeld
9f608435ee
Fix errors in when languages have no fields
2019-02-12 17:20:12 -08:00
Max Brunsfeld
56309a1c28
Generate node-fields.json file
2019-02-12 11:06:18 -08:00
Max Brunsfeld
d8a2c0dda2
Use a separate type for storing field map headers
2019-02-08 16:06:29 -08:00
Max Brunsfeld
1d1674811c
Fully implement ts_node_child_by_field_id
2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d
Get basic field API working
2019-02-08 15:16:56 -08:00
Max Brunsfeld
0f2347b318
Just call the C lib 'the library' everywhere, don't call it a 'runtime'
2019-01-10 15:22:39 -08:00
Max Brunsfeld
dd416b0955
Update include paths to not reference 'runtime' directory
2019-01-04 17:33:34 -08:00
Max Brunsfeld
47607cecf4
Reorganize repo, add rust CLI and binding code,
2019-01-04 17:31:49 -08:00