| ... | @@ -181,6 +181,7 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d | ... | @@ -181,6 +181,7 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d |
| 181 | switch (comptime TI) { | 181 | switch (comptime TI) { |
| 182 | .Bool => try doif(alloc, writer, body, bottom, data, ctx, opts, x), | 182 | .Bool => try doif(alloc, writer, body, bottom, data, ctx, opts, x), |
| 183 | .Optional => try docap(alloc, writer, body, bottom, data, ctx, opts, x), | 183 | .Optional => try docap(alloc, writer, body, bottom, data, ctx, opts, x), |
| | 184 | .Int => try doif(alloc, writer, body, bottom, data, ctx, opts, x != 0), |
| 184 | else => @compileError(std.fmt.comptimePrint("pek: unable to use '{s}' in an #if block", .{@typeName(T)})), | 185 | else => @compileError(std.fmt.comptimePrint("pek: unable to use '{s}' in an #if block", .{@typeName(T)})), |
| 185 | } | 186 | } |
| 186 | }, | 187 | }, |
| ... | @@ -211,6 +212,7 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d | ... | @@ -211,6 +212,7 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d |
| 211 | switch (comptime TI) { | 212 | switch (comptime TI) { |
| 212 | .Bool => try doif(alloc, writer, body, bottom, data, ctx, opts, !x), | 213 | .Bool => try doif(alloc, writer, body, bottom, data, ctx, opts, !x), |
| 213 | .Optional => try docap(alloc, writer, body, bottom, data, ctx, opts, !x), | 214 | .Optional => try docap(alloc, writer, body, bottom, data, ctx, opts, !x), |
| | 215 | .Int => try doif(alloc, writer, body, bottom, data, ctx, opts, x == 0), |
| 214 | else => @compileError(std.fmt.comptimePrint("pek: unable to use '{s}' in an #ifnot block", .{@typeName(T)})), | 216 | else => @compileError(std.fmt.comptimePrint("pek: unable to use '{s}' in an #ifnot block", .{@typeName(T)})), |
| 215 | } | 217 | } |
| 216 | }, | 218 | }, |