From 22811834abe3603e28128a17ac004b1aeea3d651 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 17 Jan 2026 12:30:34 +0900 Subject: implement identity filter --- src/jq/execute.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/jq/execute.zig (limited to 'src/jq/execute.zig') diff --git a/src/jq/execute.zig b/src/jq/execute.zig new file mode 100644 index 0000000..9857d46 --- /dev/null +++ b/src/jq/execute.zig @@ -0,0 +1,22 @@ +const std = @import("std"); +const jv = @import("../jv.zig"); +const Instr = @import("./compile.zig").Instr; + +pub const ExecuteError = error{ + Unimplemented, +}; + +pub fn execute(allocator: std.mem.Allocator, instrs: []const Instr, input: jv.Value) !jv.Value { + _ = allocator; + const len = instrs.len; + var pc: usize = 0; + while (pc < len) { + const cur = instrs[pc]; + _ = switch (cur.op) { + .nop => void, + .identity => return input, + }; + pc += 1; + } + return ExecuteError.Unimplemented; +} -- cgit v1.3-1-g0d28