diff options
author | Lorenzo Torres <torres@sideros.org> | 2025-03-29 21:20:16 +0100 |
---|---|---|
committer | Lorenzo Torres <torres@sideros.org> | 2025-03-29 21:20:16 +0100 |
commit | 9ff5e811a8642c59556df077b0c258f1af083480 (patch) | |
tree | e77013a53b692a7c49f82ffdf41befd5ca7b214f /src/mods/ir.zig | |
parent | 16a2a404189cc6b5cd3493df8d19298af7e542ce (diff) | |
parent | 2dc07080dd67ffdd67b6f5fe3ad74b113c6daca9 (diff) |
Merge branch 'master' of ssh://git.sideros.org:/git/sideros
Diffstat (limited to 'src/mods/ir.zig')
-rw-r--r-- | src/mods/ir.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mods/ir.zig b/src/mods/ir.zig index 25409e4..e745cb8 100644 --- a/src/mods/ir.zig +++ b/src/mods/ir.zig @@ -1,5 +1,6 @@ const std = @import("std"); const Parser = @import("Parser.zig"); +const vm = @import("vm.zig"); const Allocator = std.mem.Allocator; @@ -44,7 +45,7 @@ opcodes: []Opcode, indices: []Index, // TODO: this could be a byte array and v128.const and i8x16.shuffle could live here too -select_valtypes: []Parser.Valtype, +select_valtypes: []vm.Valtype, pub fn print(self: IR, writer: anytype) !void { for (self.opcodes, 0..) |op, i| { @@ -621,8 +622,8 @@ const IRParserState = struct { fn parseExpression(self: *IRParserState) Parser.Error!void { const b = try self.parser.readByte(); try switch (b) { - 0x00 => {}, // TODO - 0x01 => {}, + 0x00 => self.push(@enumFromInt(b), .{ .u64 = 0 }), + 0x01 => self.push(@enumFromInt(b), .{ .u64 = 0 }), 0x02...0x03 => self.parseBlock(b), 0x04 => self.parseIf(), 0x0C...0x0D => self.parseBranch(b), |