fix(lib): check point, byte ranges in node_descendant_for

functions
This commit is contained in:
WillLillis 2024-11-02 00:53:03 -04:00 committed by Amaan Qureshi
parent 5b5cf5a5e5
commit 8c802da174

View file

@ -348,6 +348,9 @@ static inline TSNode ts_node__descendant_for_byte_range(
uint32_t range_end,
bool include_anonymous
) {
if (range_start > range_end) {
return ts_node__null();
}
TSNode node = self;
TSNode last_visible_node = self;
@ -391,6 +394,9 @@ static inline TSNode ts_node__descendant_for_point_range(
TSPoint range_end,
bool include_anonymous
) {
if (point_gt(range_start, range_end)) {
return ts_node__null();
}
TSNode node = self;
TSNode last_visible_node = self;