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 {...@@ -19,13 +19,13 @@ pub fn parse(comptime input: []const u8) astgen.Value {
19 return astgen.Value{ .element = astgen.do(tokenize.do(input, &.{ '[', '=', ']', '(', ')', '{', '}', '#', '/', '.', '<', '>' })) };19 return astgen.Value{ .element = astgen.do(tokenize.do(input, &.{ '[', '=', ']', '(', ')', '{', '}', '#', '/', '.', '<', '>' })) };
20}20}
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 {
23 try writer.writeAll("<!DOCTYPE html>\n");23 try writer.writeAll("<!DOCTYPE html>\n");
24 try do(alloc, writer, value, data, data, 0, false);24 try do(alloc, writer, value, data, data, 0, false);
25 try writer.writeAll("\n");25 try writer.writeAll("\n");
26}26}
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 {
29 switch (comptime value) {29 switch (comptime value) {
30 .element => |v| {30 .element => |v| {
31 const hastext = for (v.children) |x| {31 const hastext = for (v.children) |x| {
...@@ -249,7 +249,7 @@ fn contains(haystack: []const []const u8, needle: []const u8) bool {...@@ -249,7 +249,7 @@ fn contains(haystack: []const []const u8, needle: []const u8) bool {
249 return false;249 return false;
250}250}
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 {
253 if (flag2) {253 if (flag2) {
254 try do(alloc, writer, top, data, ctx, indent, flag1);254 try do(alloc, writer, top, data, ctx, indent, flag1);
255 } else {255 } else {
...@@ -257,7 +257,7 @@ fn doif(alloc: *std.mem.Allocator, writer: anytype, comptime top: astgen.Value,...@@ -257,7 +257,7 @@ fn doif(alloc: *std.mem.Allocator, writer: anytype, comptime top: astgen.Value,
257 }257 }
258}258}
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 {
261 if (flag2) |_| {261 if (flag2) |_| {
262 try do(alloc, writer, top, data, ctx, indent, flag1);262 try do(alloc, writer, top, data, ctx, indent, flag1);
263 } else {263 } else {