Make tables work and add rawEquals methods

Since hashtables are a hassle with strings and complex datastructures
like the table they are an arraylist for now.

Also implement rawEquals for numerals and values to make table.get work
This commit is contained in:
0x4261756D
2023-11-24 03:22:15 +01:00
parent cfc288e279
commit 5dc1b9d50b
2 changed files with 152 additions and 12 deletions

View File

@ -4,7 +4,7 @@ const types = @import("types.zig");
pub fn interpret(root: parser.ChunkNode, allocator: std.mem.Allocator) !void
{
var _ENV = types.Table { .items = std.HashMap(types.Value, types.Value, std.hash_map.AutoContext(types.Value), std.hash_map.default_max_load_percentage).init(allocator) };
var _ENV = types.Table { .entries= std.ArrayList(types.TableEntry).init(allocator) };
try walkChunk(root, &_ENV, allocator);
}