Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/Walk.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const Oom = error{OutOfMemory};

pub const Decl = @import("Decl.zig");

pub var files: std.StringArrayHashMapUnmanaged(File) = .empty;
pub var files: std.array_hash_map.String(File) = .empty;
pub var decls: std.ArrayList(Decl) = .empty;
pub var modules: std.StringArrayHashMapUnmanaged(File.Index) = .empty;
pub var modules: std.array_hash_map.String(File.Index) = .empty;

pub fn deinit() void {
for (files.values()) |*file| {
Expand Down Expand Up @@ -73,17 +73,17 @@ pub const Category = union(enum(u8)) {
pub const File = struct {
ast: Ast,
/// Maps identifiers to the declarations they point to.
ident_decls: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,
ident_decls: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
/// Maps field access identifiers to the containing field access node.
token_parents: std.AutoArrayHashMapUnmanaged(Ast.TokenIndex, Ast.Node.Index) = .empty,
token_parents: std.array_hash_map.Auto(Ast.TokenIndex, Ast.Node.Index) = .empty,
/// Maps declarations to their global index.
node_decls: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Decl.Index) = .empty,
node_decls: std.array_hash_map.Auto(Ast.Node.Index, Decl.Index) = .empty,
/// Maps function declarations to doctests.
doctests: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, Ast.Node.Index) = .empty,
doctests: std.array_hash_map.Auto(Ast.Node.Index, Ast.Node.Index) = .empty,
/// root node => its namespace scope
/// struct/union/enum/opaque decl node => its namespace scope
/// local var decl node => its local variable scope
scopes: std.AutoArrayHashMapUnmanaged(Ast.Node.Index, *Scope) = .empty,
scopes: std.array_hash_map.Auto(Ast.Node.Index, *Scope) = .empty,
top_scope: ?*Scope = null,

fn deinit(file: *File) void {
Expand Down Expand Up @@ -576,8 +576,8 @@ pub const Scope = struct {
const Namespace = struct {
base: Scope = .{ .tag = .namespace },
parent: *Scope,
names: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,
doctests: std.StringArrayHashMapUnmanaged(Ast.Node.Index) = .empty,
names: std.array_hash_map.String(Ast.Node.Index) = .empty,
doctests: std.array_hash_map.String(Ast.Node.Index) = .empty,
decl_index: Decl.Index,

fn deinit(namespace: *Namespace) void {
Expand Down