From bbe4bc5a08a042b47a3474e8e9caf20e216634a8 Mon Sep 17 00:00:00 2001 From: Jose Colon Rodriguez Date: Tue, 13 Feb 2024 13:50:22 -0400 Subject: Passing ziglyph tests --- src/gbp_gen.zig | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/gbp_gen.zig') diff --git a/src/gbp_gen.zig b/src/gbp_gen.zig index afc54fc..7e27f35 100644 --- a/src/gbp_gen.zig +++ b/src/gbp_gen.zig @@ -62,8 +62,6 @@ pub fn main() !void { var blocks_map = BlockMap.init(allocator); defer blocks_map.deinit(); - const no_prop = std.math.maxInt(u16); - var stage1 = std.ArrayList(u16).init(allocator); defer stage1.deinit(); @@ -101,12 +99,7 @@ pub fn main() !void { try stage2.appendSlice(block[0..block_len]); } - if (prop == .none) { - try stage1.append(no_prop); - } else { - try stage1.append(gop.value_ptr.*); - } - + try stage1.append(gop.value_ptr.*); block_len = 0; } @@ -120,8 +113,6 @@ pub fn main() !void { const writer = out_buf.writer(); const prop_code = - \\const std = @import("std"); - \\ \\const Prop = enum { \\ none, \\ @@ -161,11 +152,8 @@ pub fn main() !void { try writer.writeAll("};\n"); const code = - \\const no_prop = std.math.maxInt(u16); - \\ \\inline fn getProp(cp: u21) Prop { \\ const stage_1_index = cp >> 8; - \\ if (stage_1[stage_1_index] == no_prop) return .none; \\ const stage_2_index = stage_1[stage_1_index] + (cp & 0xff); \\ const stage_3_index = stage_2[stage_2_index]; \\ return stage_3[stage_3_index]; -- cgit v1.2.3