authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-28 22:12:24 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-28 22:12:24 -08:00
logaf9c467d2eea9ca07e1ba66b2b02c1e6fc082ffb
tree12e86dad61fb8ff5aea6ae954df92716aa750156
parent706924ca682479a77cc64b1a1fa0f666365721ec

make do only inline in release mode


1 files changed, 4 insertions(+), 1 deletions(-)

src/lib.zig+4-1
......@@ -13,10 +13,13 @@ const htmlentities = @import("htmlentities");
1313const root = @import("root");
1414const tracer = @import("tracer");
1515const extras = @import("extras");
16const builtin = @import("builtin");
1617
1718const tokenize = @import("./tokenize.zig");
1819const astgen = @import("./astgen.zig");
1920
21const callconv_inline: std.builtin.CallingConvention = if (builtin.mode == .Debug) .auto else .@"inline";
22
2023pub fn parse(comptime input: string) astgen.Value {
2124 return astgen.Value{ .element = astgen.do(tokenize.do(input, &.{ '[', '=', ']', '(', ')', '{', '}', '#', '/', '.', '<', '>' })) };
2225}
......@@ -41,7 +44,7 @@ pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: a
4144
4245pub const Writer = std.ArrayList(u8).Writer;
4346
44inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void {
47fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) callconv(callconv_inline) anyerror!void {
4548 switch (comptime value) {
4649 .element => |v| {
4750 const hastext = comptime for (v.children) |x| {