style: rephrase extends beyond to contains or starts after

This commit is contained in:
Amaan Qureshi 2024-12-28 18:35:37 -05:00
parent d2db7eb8ef
commit 5d99014bb8
4 changed files with 14 additions and 14 deletions

View file

@ -465,11 +465,11 @@ extern "C" {
pub fn ts_node_prev_named_sibling(self_: TSNode) -> TSNode;
}
extern "C" {
#[doc = " Get the node's first child that extends beyond the given byte offset."]
#[doc = " Get the node's first child that contains or starts after the given byte offset."]
pub fn ts_node_first_child_for_byte(self_: TSNode, byte: u32) -> TSNode;
}
extern "C" {
#[doc = " Get the node's first named child that extends beyond the given byte offset."]
#[doc = " Get the node's first named child that contains or starts after the given byte offset."]
pub fn ts_node_first_named_child_for_byte(self_: TSNode, byte: u32) -> TSNode;
}
extern "C" {
@ -569,7 +569,7 @@ extern "C" {
pub fn ts_tree_cursor_current_depth(self_: *const TSTreeCursor) -> u32;
}
extern "C" {
#[doc = " Move the cursor to the first child of its current node that extends beyond\n the given byte offset or point.\n\n This returns the index of the child node if one was found, and returns -1\n if no such child was found."]
#[doc = " Move the cursor to the first child of its current node that contains or starts after\n the given byte offset or point.\n\n This returns the index of the child node if one was found, and returns -1\n if no such child was found."]
pub fn ts_tree_cursor_goto_first_child_for_byte(
self_: *mut TSTreeCursor,
goal_byte: u32,

View file

@ -1909,14 +1909,14 @@ impl<'tree> Node<'tree> {
Self::new(unsafe { ffi::ts_node_prev_named_sibling(self.0) })
}
/// Get the node's first child that extends beyond the given byte offset.
/// Get the node's first child that contains or starts after the given byte offset.
#[doc(alias = "ts_node_first_child_for_byte")]
#[must_use]
pub fn first_child_for_byte(&self, byte: usize) -> Option<Self> {
Self::new(unsafe { ffi::ts_node_first_child_for_byte(self.0, byte as u32) })
}
/// Get the node's first named child that extends beyond the given byte offset.
/// Get the node's first named child that contains or starts after the given byte offset.
#[doc(alias = "ts_node_first_named_child_for_point")]
#[must_use]
pub fn first_named_child_for_byte(&self, byte: usize) -> Option<Self> {
@ -2162,8 +2162,8 @@ impl<'cursor> TreeCursor<'cursor> {
unsafe { ffi::ts_tree_cursor_goto_previous_sibling(&mut self.0) }
}
/// Move this cursor to the first child of its current node that extends
/// beyond the given byte offset.
/// Move this cursor to the first child of its current node that contains or
/// starts after the given byte offset.
///
/// This returns the index of the child node if one was found, and returns
/// `None` if no such child was found.
@ -2174,8 +2174,8 @@ impl<'cursor> TreeCursor<'cursor> {
(result >= 0).then_some(result as usize)
}
/// Move this cursor to the first child of its current node that extends
/// beyond the given byte offset.
/// Move this cursor to the first child of its current node that contains or
/// starts after the given byte offset.
///
/// This returns the index of the child node if one was found, and returns
/// `None` if no such child was found.

View file

@ -576,7 +576,7 @@ describe('Node', () => {
});
describe('.firstChildForIndex(index)', () => {
it('returns the first child that extends beyond the given index', () => {
it('returns the first child that contains or starts after the given index', () => {
tree = parser.parse('x10 + 1000');
const sumNode = tree.rootNode.firstChild.firstChild;
@ -588,7 +588,7 @@ describe('Node', () => {
});
describe('.firstNamedChildForIndex(index)', () => {
it('returns the first child that extends beyond the given index', () => {
it('returns the first child that contains or starts after the given index', () => {
tree = parser.parse('x10 + 1000');
const sumNode = tree.rootNode.firstChild.firstChild;

View file

@ -694,12 +694,12 @@ TSNode ts_node_next_named_sibling(TSNode self);
TSNode ts_node_prev_named_sibling(TSNode self);
/**
* Get the node's first child that extends beyond the given byte offset.
* Get the node's first child that contains or starts after the given byte offset.
*/
TSNode ts_node_first_child_for_byte(TSNode self, uint32_t byte);
/**
* Get the node's first named child that extends beyond the given byte offset.
* Get the node's first named child that contains or starts after the given byte offset.
*/
TSNode ts_node_first_named_child_for_byte(TSNode self, uint32_t byte);
@ -860,7 +860,7 @@ uint32_t ts_tree_cursor_current_descendant_index(const TSTreeCursor *self);
uint32_t ts_tree_cursor_current_depth(const TSTreeCursor *self);
/**
* Move the cursor to the first child of its current node that extends beyond
* Move the cursor to the first child of its current node that contains or starts after
* the given byte offset or point.
*
* This returns the index of the child node if one was found, and returns -1