feat: Reintroduce depth

Some decision-making might depend on the level of the traversal, so
it makes sense to expose depth here since it's stable, and not in the
automatic walker where it's not.
This commit is contained in:
Henry Kupty 2025-09-25 22:20:52 +02:00 committed by Ryan Liptak
parent 760127a760
commit df394faf77

View file

@ -732,6 +732,10 @@ pub const SelectiveWalker = struct {
});
}
pub fn depth(self: *SelectiveWalker) usize {
return self.stack.items.len;
}
pub fn deinit(self: *SelectiveWalker) void {
self.name_buffer.deinit(self.allocator);
self.stack.deinit(self.allocator);