mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
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:
parent
760127a760
commit
df394faf77
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user