style: rephrase extends beyond to contains or starts after
This commit is contained in:
parent
d2db7eb8ef
commit
5d99014bb8
4 changed files with 14 additions and 14 deletions
|
|
@ -465,11 +465,11 @@ extern "C" {
|
||||||
pub fn ts_node_prev_named_sibling(self_: TSNode) -> TSNode;
|
pub fn ts_node_prev_named_sibling(self_: TSNode) -> TSNode;
|
||||||
}
|
}
|
||||||
extern "C" {
|
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;
|
pub fn ts_node_first_child_for_byte(self_: TSNode, byte: u32) -> TSNode;
|
||||||
}
|
}
|
||||||
extern "C" {
|
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;
|
pub fn ts_node_first_named_child_for_byte(self_: TSNode, byte: u32) -> TSNode;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -569,7 +569,7 @@ extern "C" {
|
||||||
pub fn ts_tree_cursor_current_depth(self_: *const TSTreeCursor) -> u32;
|
pub fn ts_tree_cursor_current_depth(self_: *const TSTreeCursor) -> u32;
|
||||||
}
|
}
|
||||||
extern "C" {
|
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(
|
pub fn ts_tree_cursor_goto_first_child_for_byte(
|
||||||
self_: *mut TSTreeCursor,
|
self_: *mut TSTreeCursor,
|
||||||
goal_byte: u32,
|
goal_byte: u32,
|
||||||
|
|
|
||||||
|
|
@ -1909,14 +1909,14 @@ impl<'tree> Node<'tree> {
|
||||||
Self::new(unsafe { ffi::ts_node_prev_named_sibling(self.0) })
|
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")]
|
#[doc(alias = "ts_node_first_child_for_byte")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn first_child_for_byte(&self, byte: usize) -> Option<Self> {
|
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) })
|
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")]
|
#[doc(alias = "ts_node_first_named_child_for_point")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn first_named_child_for_byte(&self, byte: usize) -> Option<Self> {
|
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) }
|
unsafe { ffi::ts_tree_cursor_goto_previous_sibling(&mut self.0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move this cursor to the first child of its current node that extends
|
/// Move this cursor to the first child of its current node that contains or
|
||||||
/// beyond the given byte offset.
|
/// starts after the given byte offset.
|
||||||
///
|
///
|
||||||
/// This returns the index of the child node if one was found, and returns
|
/// This returns the index of the child node if one was found, and returns
|
||||||
/// `None` if no such child was found.
|
/// `None` if no such child was found.
|
||||||
|
|
@ -2174,8 +2174,8 @@ impl<'cursor> TreeCursor<'cursor> {
|
||||||
(result >= 0).then_some(result as usize)
|
(result >= 0).then_some(result as usize)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move this cursor to the first child of its current node that extends
|
/// Move this cursor to the first child of its current node that contains or
|
||||||
/// beyond the given byte offset.
|
/// starts after the given byte offset.
|
||||||
///
|
///
|
||||||
/// This returns the index of the child node if one was found, and returns
|
/// This returns the index of the child node if one was found, and returns
|
||||||
/// `None` if no such child was found.
|
/// `None` if no such child was found.
|
||||||
|
|
|
||||||
|
|
@ -576,7 +576,7 @@ describe('Node', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.firstChildForIndex(index)', () => {
|
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');
|
tree = parser.parse('x10 + 1000');
|
||||||
const sumNode = tree.rootNode.firstChild.firstChild;
|
const sumNode = tree.rootNode.firstChild.firstChild;
|
||||||
|
|
||||||
|
|
@ -588,7 +588,7 @@ describe('Node', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.firstNamedChildForIndex(index)', () => {
|
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');
|
tree = parser.parse('x10 + 1000');
|
||||||
const sumNode = tree.rootNode.firstChild.firstChild;
|
const sumNode = tree.rootNode.firstChild.firstChild;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -694,12 +694,12 @@ TSNode ts_node_next_named_sibling(TSNode self);
|
||||||
TSNode ts_node_prev_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);
|
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);
|
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);
|
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.
|
* the given byte offset or point.
|
||||||
*
|
*
|
||||||
* This returns the index of the child node if one was found, and returns -1
|
* This returns the index of the child node if one was found, and returns -1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue