This commit is contained in:
agra
2026-02-28 18:03:38 +02:00
parent 2552882ce6
commit 6a920dbd2c
24 changed files with 14084 additions and 780 deletions

View File

@@ -318,6 +318,20 @@ pub const Interpreter = struct {
.cmp_le => |b| return .{ .value = .{ .boolean = try self.evalCmp(frame, b, .le) } },
.cmp_gt => |b| return .{ .value = .{ .boolean = try self.evalCmp(frame, b, .gt) } },
.cmp_ge => |b| return .{ .value = .{ .boolean = try self.evalCmp(frame, b, .ge) } },
.str_eq => |b| {
const lhs = frame.getRef(b.lhs);
const rhs = frame.getRef(b.rhs);
const ls = if (lhs == .string) lhs.string else "";
const rs = if (rhs == .string) rhs.string else "";
return .{ .value = .{ .boolean = std.mem.eql(u8, ls, rs) } };
},
.str_ne => |b| {
const lhs = frame.getRef(b.lhs);
const rhs = frame.getRef(b.rhs);
const ls = if (lhs == .string) lhs.string else "";
const rs = if (rhs == .string) rhs.string else "";
return .{ .value = .{ .boolean = !std.mem.eql(u8, ls, rs) } };
},
// ── Logical ─────────────────────────────────────────
.bool_and => |b| {
@@ -824,6 +838,9 @@ pub const Interpreter = struct {
const val = try self.getGlobal(gid);
return .{ .value = val };
},
.func_ref => |fid| {
return .{ .value = .{ .func_ref = fid } };
},
.global_set => |gs| {
const val = frame.getRef(gs.value);
self.global_values.put(gs.global.index(), val) catch {};