Andrew Hlynskyi
1ac134a97d
Apply ts_node_is_error in Rust binding
2023-08-02 00:27:19 +03:00
Daumantas Kavolis
1f52f2f1dc
Symbols without aliases should be used for lookahead
2023-08-02 00:02:33 +03:00
Daumantas Kavolis
c47e217e73
API extensions
2023-08-02 00:02:33 +03: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
Jille Timmermans
9a74f5cbf5
Add ts_node_language() that returns the language of the node
...
Since an input might have a nested sublanguage (like Javascript inside
Vue) and symbols are per-language, we need to know which language a node
is.
2023-07-13 11:21:18 -04:00
Max Brunsfeld
9dd725b4e3
Start work on exposing APIs for node descendant counts and indices
2023-06-09 08:51:47 -07:00
Andrew Hlynskyi
0261a13984
lib: fix ts_node_field_name_for_child implementation
...
With hidden subtrees correct incorporation and field inheritance support.
2023-04-04 16:54:32 +03:00
Sebastian Lackner
1245d54fb8
Fix crash in ts_node_field_name_for_child when no children are present
2022-07-27 12:26:35 +02: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
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
Niranjan Hasabnis
3be4bc7abb
Syntactic improvements
2021-05-17 17:52:52 +00:00
Niranjan Hasabnis
dffee22736
Adding API to get field name of a TSNode
...
This PR adds an API to get name of the field of TSNode's child.
It uses same set of arguments as that of ts_node_child, but returns
field name if it is found, otherwise it returns NULL.
This API is useful to implement custom printing of S-expressions such
as following:
"(binary_expression
(binary_expression_left (identifier))
(binary_expression_operator ("+"))
(binary_expression_right (identifier)
)"
Currently, ts_node_string does not allow any customization for printing.
2021-05-15 00:20:18 +00:00
Max Brunsfeld
73e252e39b
Add unit test for child_by_field_name w/ hidden nodes
2021-02-10 16:14:24 -08:00
Wojciech Kordalski
8e89b8cdb8
Fix getting node by field name or ID.
2021-01-22 18:23:50 +01:00
Max Brunsfeld
d533d1f076
Allocate parent nodes together with their child array
2020-10-23 12:15:44 -07:00
Max Brunsfeld
35f82ce301
Fix incorrect parent values after call to child_by_field_name
...
Refs tree-sitter/node-tree-sitter#61
Refs tree-sitter/tree-sitter-javascript#127
2020-04-03 11:21:51 -07:00
Max Brunsfeld
56c620c005
Store a mapping to ensure no two symbols map to the same metadata
2019-12-05 17:21:46 -08:00
Max Brunsfeld
0955c5b3d7
Handle named nodes aliased as anonymous nodes
...
Fixes #401
2019-08-29 14:28:44 -07:00
Max Brunsfeld
28011b1e60
Add ts_node_is_extra API
2019-06-19 15:58:29 -07:00
Max Brunsfeld
80b785daee
Improve behavior of node descendant queries with single positions
2019-06-13 10:53:59 -07:00
Max Brunsfeld
58e1a0fee7
In node range queries, treat the end coordinate as exclusive
2019-04-26 13:36:28 -07:00
Max Brunsfeld
5035e194ff
Merge branch 'master' into node-fields
2019-03-26 11:58:21 -07:00
Max Brunsfeld
5a59f19b69
Use explicit syntax for functions with no parameters
2019-03-21 16:06:06 -07: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
bf4e1304f8
Start work on new ref API, for giving names to nodes' children
...
Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
2019-02-08 15:16:56 -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