feat: folding logical operations
This commit is contained in:
parent
92e8bcd866
commit
2260ccda25
24 changed files with 310 additions and 151 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue