summaryrefslogtreecommitdiff
path: root/src/syntax.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.zig')
-rw-r--r--src/syntax.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/syntax.zig b/src/syntax.zig
index 1787335e..a498357c 100644
--- a/src/syntax.zig
+++ b/src/syntax.zig
@@ -436,9 +436,9 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a
const tree: *const ts.Tree = @ptrCast(@alignCast(tree_ptr));
const lo: u32 = @intCast(@min(from, std.math.maxInt(u32)));
const hi: u32 = @intCast(@min(to, std.math.maxInt(u32)));
- if (walk == .parent_end or walk == .parent_start) {
+ if (walk == .parent_node_end or walk == .parent_node_start) {
var node = tree.rootNode().namedDescendantForByteRange(lo, hi) orelse return 0;
- if (walk == .parent_end) {
+ if (walk == .parent_node_end) {
out[0] = .{ .from = node.endByte(), .to = node.endByte() };
return 1;
}
@@ -462,10 +462,10 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a
if (cursor.gotoFirstChildForByte(lo) == null) break;
}
switch (walk) {
- .expand => while (cursor.node().startByte() == lo and cursor.node().endByte() == hi) {
+ .expand_node => while (cursor.node().startByte() == lo and cursor.node().endByte() == hi) {
if (!cursor.gotoParent()) break;
},
- .shrink => _ = cursor.gotoFirstChild(),
+ .shrink_node => _ = cursor.gotoFirstChild(),
.next_sibling => while (!cursor.gotoNextSibling()) {
if (!cursor.gotoParent()) break;
},
@@ -492,7 +492,7 @@ pub fn walkNodes(tree_ptr: *anyopaque, walk: NodeWalk, from: usize, to: usize, a
}
return n;
},
- .parent_end, .parent_start => unreachable,
+ .parent_node_end, .parent_node_start => unreachable,
}
const node = cursor.node();
out[0] = .{ .from = node.startByte(), .to = node.endByte() };