authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-24 20:32:16 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-24 20:32:16 -08:00
logb1ea50c5214e9c69708e83d519b3389338e8d9cc
treec1f2c6e1600fcfbf4b2cc6c53da7e78ff3606669
parent2352c1b2b2a15b3ce60914adcbc9567184efac59

update for zig 0.9.0


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

src/lib.zig+4-4
......@@ -19,13 +19,13 @@ pub fn parse(comptime input: []const u8) astgen.Value {
1919 return astgen.Value{ .element = astgen.do(tokenize.do(input, &.{ '[', '=', ']', '(', ')', '{', '}', '#', '/', '.', '<', '>' })) };
2020}
2121
22pub fn compile(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype) !void {
22pub fn compile(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype) !void {
2323 try writer.writeAll("<!DOCTYPE html>\n");
2424 try do(alloc, writer, value, data, data, 0, false);
2525 try writer.writeAll("\n");
2626}
2727
28fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool) anyerror!void {
28fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool) anyerror!void {
2929 switch (comptime value) {
3030 .element => |v| {
3131 const hastext = for (v.children) |x| {
......@@ -249,7 +249,7 @@ fn contains(haystack: []const []const u8, needle: []const u8) bool {
249249 return false;
250250}
251251
252fn doif(alloc: *std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool, flag2: bool) anyerror!void {
252fn doif(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool, flag2: bool) anyerror!void {
253253 if (flag2) {
254254 try do(alloc, writer, top, data, ctx, indent, flag1);
255255 } else {
......@@ -257,7 +257,7 @@ fn doif(alloc: *std.mem.Allocator, writer: anytype, comptime top: astgen.Value,
257257 }
258258}
259259
260fn docap(alloc: *std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool, flag2: anytype) anyerror!void {
260fn docap(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, indent: usize, flag1: bool, flag2: anytype) anyerror!void {
261261 if (flag2) |_| {
262262 try do(alloc, writer, top, data, ctx, indent, flag1);
263263 } else {