diff --git a/examples/hello.ry b/examples/hello.ry index 482c1f7..4c0dad8 100644 --- a/examples/hello.ry +++ b/examples/hello.ry @@ -7,7 +7,7 @@ fn f() i32 { return 2; } -fn f2() i32 { +fn f2() i64 { return 1301; } diff --git a/src/comp_ctx.zig b/src/comp_ctx.zig index 0a407e3..ac1cfa8 100644 --- a/src/comp_ctx.zig +++ b/src/comp_ctx.zig @@ -31,10 +31,11 @@ pub const SymbolUnderlyingType = union(SymbolUnderlyingTypeEnum) { Enum: []const u8, }; +pub const Environment = std.StringHashMap(SymbolUnderlyingType); pub const ScopeList = std.ArrayList(*Scope); pub const Scope = struct { parent: ?*Scope, - env: UnderlyingTypeMap, + env: Environment, /// Used for debug information. children: ScopeList, @@ -47,7 +48,7 @@ pub const Scope = struct { scope.* = Scope{ .parent = parent, - .env = UnderlyingTypeMap.init(allocator), + .env = Environment.init(allocator), .children = ScopeList.init(allocator), .allocator = allocator, .id = id,