Restructure query_cursor_advance to explicitly control which hidden nodes it descends into

This commit is contained in:
Max Brunsfeld 2023-02-15 14:03:15 -08:00
parent 29c9073177
commit fa869cf3ed
2 changed files with 492 additions and 428 deletions

View file

@ -291,6 +291,12 @@ static inline uint32_t ts_subtree_repeat_depth(Subtree self) {
return self.data.is_inline ? 0 : self.ptr->repeat_depth;
}
static inline uint32_t ts_subtree_is_repetition(Subtree self) {
return self.data.is_inline
? 0
: !self.ptr->named && !self.ptr->visible && self.ptr->child_count != 0;
}
static inline uint32_t ts_subtree_node_count(Subtree self) {
return (self.data.is_inline || self.ptr->child_count == 0) ? 1 : self.ptr->node_count;
}