authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-20 10:53:07 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-20 10:53:07 -07:00
log6ea8d9f07367a52b335deaf2dcbb6e44ab6640cd
tree1654189774fb464f74d3dca32bc1f8c56f55821a
parent7062632e64ba10c8d18c53586b02eb015fe43ba9

add compileInner for use in custom raw functions


1 files changed, 5 insertions(+), 0 deletions(-)

src/lib.zig+5
...@@ -30,6 +30,11 @@ pub fn compile(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, co...@@ -30,6 +30,11 @@ pub fn compile(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, co
30 try writer.writeAll("\n");30 try writer.writeAll("\n");
31}31}
3232
33pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, comptime opts: DoOptions, data: anytype) !void {
34 try do(alloc, writer, value, data, data, opts);
35 try writer.writeAll("\n");
36}
37
33pub const Writer = std.ArrayList(u8).Writer;38pub const Writer = std.ArrayList(u8).Writer;
3439
35inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void {40inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void {