feat: folding logical operations

This commit is contained in:
Brett Broadhurst 2026-03-29 04:49:03 -06:00
parent 92e8bcd866
commit 2260ccda25
Failed to generate hash of commit
24 changed files with 310 additions and 151 deletions

View file

@ -279,20 +279,18 @@ pub fn dumpKnot(self: *Dumper, w: *std.Io.Writer, knot: *const Object.Knot) !voi
pub fn dumpValue(_: Dumper, w: *std.Io.Writer, value: *const Value) !void {
switch (value.*) {
.bool => |boolean| try w.print("<{s} value={s}>", .{
value.tagBytes(),
if (boolean) "true" else "false",
}),
.int => |int| try w.print("<{s} value={d}, address={*}>", .{
value.tagBytes(),
int,
value,
}),
.float => |float| try w.print("<{s} value={d}, address={*}>", .{
value.tagBytes(),
float,
value,
}),
.bool => |_| try w.print(
"<{s} value={f}>",
.{ value.tagBytes(), value },
),
.int => |_| try w.print(
"<{s} value={f}, address={*}>",
.{ value.tagBytes(), value, value },
),
.float => |_| try w.print(
"<{s} value={f}, address={*}>",
.{ value.tagBytes(), value, value },
),
.object => |object| switch (object.tag) {
.string => {
const typed_object: *const Object.String = @ptrCast(object);