const Namespace = struct base: Scope = Scope{ .tag = base_tag }parent: *ScopeParents can be: LocalVal, LocalPtr, GenZir, Defer, Namespace.
decls: std.AutoHashMapUnmanaged(Zir.NullTerminatedString, Ast.Node.Index) = .emptyMaps string table index to the source location of declaration, for the purposes of reporting name shadowing compile errors.
node: Ast.Node.Indexinst: Zir.Inst.Indexmaybe_generic: booldeclaring_gz: ?*GenZirThe astgen scope containing this namespace. Only valid during astgen.
captures: std.array_hash_map.Auto(Zir.Inst.Capture, Zir.NullTerminatedString) = .emptySet of captures used by this namespace.
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231 const Namespace = struct {
const base_tag: Tag = .namespace;
base: Scope = Scope{ .tag = base_tag },
/// Parents can be: `LocalVal`, `LocalPtr`, `GenZir`, `Defer`, `Namespace`.
parent: *Scope,
/// Maps string table index to the source location of declaration,
/// for the purposes of reporting name shadowing compile errors.
decls: std.AutoHashMapUnmanaged(Zir.NullTerminatedString, Ast.Node.Index) = .empty,
node: Ast.Node.Index,
inst: Zir.Inst.Index,
maybe_generic: bool,
/// The astgen scope containing this namespace.
/// Only valid during astgen.
declaring_gz: ?*GenZir,
/// Set of captures used by this namespace.
captures: std.array_hash_map.Auto(Zir.Inst.Capture, Zir.NullTerminatedString) = .empty,
fn deinit(self: *Namespace, gpa: Allocator) void {
self.decls.deinit(gpa);
self.captures.deinit(gpa);
self.* = undefined;
}
}
Represents a global scope that has any number of declarations in it. Each declaration has this as the parent scope.