authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-13 23:16:01 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-13 23:16:01 -07:00
logf7e32bef2698466232c80e110c80051bf8204bd8
tree50e3abdb9ec0677ede22e30088c09f0078051fda
parent1f4b7a6d4cb994a8b11185485350d3cbad9b70af

allow for `<else>` block in `#ifequal` and `#ifnotequal`


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

src/lib.zig+2-2
...@@ -111,12 +111,12 @@ fn do(writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype...@@ -111,12 +111,12 @@ fn do(writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype
111 .ifequal => {111 .ifequal => {
112 comptime assertEqual(v.args.len, 2);112 comptime assertEqual(v.args.len, 2);
113 const y = if (comptime std.mem.eql(u8, v.args[1][0], "this")) search(v.args[1][1..], data) else search(v.args[1], ctx);113 const y = if (comptime std.mem.eql(u8, v.args[1][0], "this")) search(v.args[1][1..], data) else search(v.args[1], ctx);
114 if (x == y) try do(writer, body, data, ctx, indent, flag1);114 try doif(writer, body, bottom, data, ctx, indent, flag1, x == y, true);
115 },115 },
116 .ifnotequal => {116 .ifnotequal => {
117 comptime assertEqual(v.args.len, 2);117 comptime assertEqual(v.args.len, 2);
118 const y = if (comptime std.mem.eql(u8, v.args[1][0], "this")) search(v.args[1][1..], data) else search(v.args[1], ctx);118 const y = if (comptime std.mem.eql(u8, v.args[1][0], "this")) search(v.args[1][1..], data) else search(v.args[1], ctx);
119 if (x != y) try do(writer, body, data, ctx, indent, flag1);119 try doif(writer, body, bottom, data, ctx, indent, flag1, x != y, true);
120 },120 },
121 }121 }
122 },122 },