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/compile.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/jq/compile.zig') diff --git a/src/jq/compile.zig b/src/jq/compile.zig index e3937c6..f4044c9 100644 --- a/src/jq/compile.zig +++ b/src/jq/compile.zig @@ -54,6 +54,14 @@ pub fn compile(allocator: std.mem.Allocator, compile_allocator: std.mem.Allocato try instrs.append(allocator, .subexp_end); try instrs.append(allocator, .add); }, + .pipe => |pipe_expr| { + const lhs_instrs = try compile(allocator, compile_allocator, pipe_expr.lhs); + defer allocator.free(lhs_instrs); + const rhs_instrs = try compile(allocator, compile_allocator, pipe_expr.rhs); + defer allocator.free(rhs_instrs); + try instrs.appendSlice(allocator, lhs_instrs); + try instrs.appendSlice(allocator, rhs_instrs); + }, } return instrs.toOwnedSlice(allocator); -- cgit v1.3-1-g0d28