From 6eac31e028be7d8972590ca342e33bda882f813c Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 15 May 2023 19:56:58 -0700 Subject: [PATCH] pass DoOptions to raw custom functions --- src/lib.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.zig b/src/lib.zig index 76d6cbc691d1f328006af40e74b1bba43d92e180..5419b45b97de4aa2e696b991c26214565f8fcff9 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -189,8 +189,9 @@ inline fn do(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, comp var args: std.meta.ArgsTuple(@TypeOf(func)) = undefined; args.@"0" = alloc; args.@"1" = list.writer(); + args[2] = opts; inline for (v.args, 0..) |arg, i| { - const field_name = comptime std.fmt.comptimePrint("{d}", .{i + 2}); + const field_name = comptime std.fmt.comptimePrint("{d}", .{i + 3}); @field(args, field_name) = if (comptime std.mem.eql(u8, arg[0], "this")) search(arg[1..], data) else search(arg, ctx); } const repvalue = astgen.Value{ .replacement = .{ .arms = &.{"this"}, .raw = v.raw } }; -- 2.54.0