| ... | ... | @@ -13,10 +13,13 @@ const htmlentities = @import("htmlentities"); |
| 13 | 13 | const root = @import("root"); |
| 14 | 14 | const tracer = @import("tracer"); |
| 15 | 15 | const extras = @import("extras"); |
| 16 | const builtin = @import("builtin"); |
| 16 | 17 | |
| 17 | 18 | const tokenize = @import("./tokenize.zig"); |
| 18 | 19 | const astgen = @import("./astgen.zig"); |
| 19 | 20 | |
| 21 | const callconv_inline: std.builtin.CallingConvention = if (builtin.mode == .Debug) .auto else .@"inline"; |
| 22 | |
| 20 | 23 | pub fn parse(comptime input: string) astgen.Value { |
| 21 | 24 | return astgen.Value{ .element = astgen.do(tokenize.do(input, &.{ '[', '=', ']', '(', ')', '{', '}', '#', '/', '.', '<', '>' })) }; |
| 22 | 25 | } |
| ... | ... | @@ -41,7 +44,7 @@ pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: a |
| 41 | 44 | |
| 42 | 45 | pub const Writer = std.ArrayList(u8).Writer; |
| 43 | 46 | |
| 44 | | inline fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void { |
| 47 | fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) callconv(callconv_inline) anyerror!void { |
| 45 | 48 | switch (comptime value) { |
| 46 | 49 | .element => |v| { |
| 47 | 50 | const hastext = comptime for (v.children) |x| { |