feat: reverse iteration through node parents (#3214)
This commit is contained in:
parent
0f125e2d09
commit
90e0e28b95
5 changed files with 84 additions and 24 deletions
|
|
@ -548,9 +548,16 @@ TSStateId ts_node_next_parse_state(TSNode self);
|
|||
|
||||
/**
|
||||
* Get the node's immediate parent.
|
||||
* Prefer [`ts_node_child_containing_descendant`] for
|
||||
* iterating over the node's ancestors.
|
||||
*/
|
||||
TSNode ts_node_parent(TSNode self);
|
||||
|
||||
/**
|
||||
* Get the node's child that contains `descendant`.
|
||||
*/
|
||||
TSNode ts_node_child_containing_descendant(TSNode self, TSNode descendant);
|
||||
|
||||
/**
|
||||
* Get the node's child at the given index, where zero represents the first
|
||||
* child.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue