diff options
Diffstat (limited to 'src/jq/execute.zig')
| -rw-r--r-- | src/jq/execute.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jq/execute.zig b/src/jq/execute.zig index d8081e6..cee7845 100644 --- a/src/jq/execute.zig +++ b/src/jq/execute.zig @@ -4,6 +4,7 @@ const tokenize = @import("./tokenize.zig").tokenize; const parse = @import("./parse.zig").parse; const Instr = @import("./codegen.zig").Instr; const codegen = @import("./codegen.zig").codegen; +const disasm = @import("./codegen.zig").disasm; pub const ExecuteError = error{ Unimplemented, @@ -189,11 +190,6 @@ pub const Runtime = struct { const ast = try parse(self.allocator, compile_allocator.allocator(), tokens, &self.constants); const instrs = try codegen(self.allocator, ast); self.instrs = instrs; - // std.debug.print("BEGIN\n", .{}); - // for (self.instrs) |instr| { - // std.debug.print("{}\n", .{instr}); - // } - // std.debug.print("END\n", .{}); } pub fn compileFromSlice(self: *Self, query: []const u8) !void { @@ -201,6 +197,10 @@ pub const Runtime = struct { return self.compileFromReader(&reader); } + pub fn dumpDisasm(self: *const Self, writer: *std.Io.Writer) !void { + try disasm(self.allocator, self.instrs, self.constants.items, writer); + } + pub fn start(self: *Self, input: jv.Value) !void { try self.values.push(input.clone()); } |
