mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue