From 8e8fcf1dd73c785f6901cf53ce17380099d15bd1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 18 Jan 2026 00:49:33 +0900 Subject: implement pipe operator --- src/jq/execute.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jq/execute.zig') diff --git a/src/jq/execute.zig b/src/jq/execute.zig index 29025b4..8982458 100644 --- a/src/jq/execute.zig +++ b/src/jq/execute.zig @@ -100,6 +100,8 @@ pub fn execute(allocator: std.mem.Allocator, instrs: []const Instr, input: jv.Va const cur = instrs[pc]; switch (cur) { .nop => {}, + .subexp_begin => try value_stack.dup(), + .subexp_end => value_stack.swap(), .array_index => { const array = try value_stack.popArray(); const index: usize = @intCast(try value_stack.popInteger()); @@ -113,8 +115,6 @@ pub fn execute(allocator: std.mem.Allocator, instrs: []const Instr, input: jv.Va const result = lhs + rhs; try value_stack.push(.{ .integer = result }); }, - .subexp_begin => try value_stack.dup(), - .subexp_end => value_stack.swap(), .object_key => |key| { const obj = try value_stack.popObject(); const result = obj.get(key) orelse .null; -- cgit v1.3-1-g0d28