diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-01-18 00:49:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-01-18 00:53:35 +0900 |
| commit | 8e8fcf1dd73c785f6901cf53ce17380099d15bd1 (patch) | |
| tree | e0bab2aaf525ad874ce013a3ace046ff224fc86a /src/jq/execute.zig | |
| parent | 6739144edaf34d10e0c0901231b196f377007934 (diff) | |
| download | zgjq-8e8fcf1dd73c785f6901cf53ce17380099d15bd1.tar.gz zgjq-8e8fcf1dd73c785f6901cf53ce17380099d15bd1.tar.zst zgjq-8e8fcf1dd73c785f6901cf53ce17380099d15bd1.zip | |
implement pipe operator
Diffstat (limited to 'src/jq/execute.zig')
| -rw-r--r-- | src/jq/execute.zig | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
