authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-24 20:20:15 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-24 20:20:15 -08:00
loga24bb6d70c6dfa105e2375da4b23421d1057295e
treef429257ce523a51ba73567ca73f918b3c69c6a04
parent10b157fd88ac9baecd0ab2f0c5bdd36081684edc

scripts: no need for exec to return bool


22 files changed, 24 insertions(+), 63 deletions(-)

scripts/ArabicShaping.zig+1-2
......@@ -139,7 +139,7 @@ pub usingnamespace common.Main(struct {
139139 \\
140140 ;
141141
142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
143143 var it = std.mem.split(u8, line, ";");
144144 const c = std.mem.trim(u8, it.next().?, " ");
145145 const n = std.mem.trim(u8, it.next().?, " ");
......@@ -148,6 +148,5 @@ pub usingnamespace common.Main(struct {
148148 const g2 = try std.mem.replaceOwned(u8, alloc, g, " ", "_");
149149
150150 try writer.print(" .{{ .codepoint = 0x{s}, .schematic_name = \"{s}\", .joining_type = .{s}, .joining_group = .{s} }},\n", .{ c, n, t, g2 });
151 return true;
152151 }
153152});
scripts/BidiBrackets.zig+1-2
......@@ -28,7 +28,7 @@ pub usingnamespace common.Main(struct {
2828 \\
2929 ;
3030
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
3232 _ = alloc;
3333
3434 var it = std.mem.split(u8, line, ";");
......@@ -37,6 +37,5 @@ pub usingnamespace common.Main(struct {
3737 const c = std.mem.trim(u8, it.next().?, " ");
3838
3939 try writer.print(" .{{ .codepoint = 0x{s}, .pair = 0x{s}, .type = .{s} }}, // {s}\n", .{ a, b, c[0..1], c[4..] });
40 return true;
4140 }
4241});
scripts/BidiMirroring.zig+1-2
......@@ -21,7 +21,7 @@ pub usingnamespace common.Main(struct {
2121 \\
2222 ;
2323
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2525 _ = alloc;
2626 var it = std.mem.tokenize(u8, line, "; #");
2727 const c = it.next().?;
......@@ -29,6 +29,5 @@ pub usingnamespace common.Main(struct {
2929 const t = it.rest();
3030
3131 try writer.print(" .{{ .codepoint = 0x{s}, .mirror = 0x{s} }}, // {s}\n", .{ c, m, t });
32 return true;
3332 }
3433});
scripts/Blocks.zig+1-2
......@@ -22,7 +22,7 @@ pub usingnamespace common.Main(struct {
2222 \\
2323 ;
2424
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2626 _ = alloc;
2727
2828 var it1 = std.mem.split(u8, line, "; ");
......@@ -32,6 +32,5 @@ pub usingnamespace common.Main(struct {
3232 const name = it1.next().?;
3333
3434 try writer.print(" .{{ .from = 0x{s}, .to = 0x{s}, .name = \"{s}\" }},\n", .{ from, to, name });
35 return true;
3635 }
3736});
scripts/CJKRadicals.zig+1-2
......@@ -23,7 +23,7 @@ pub usingnamespace common.Main(struct {
2323 \\
2424 ;
2525
26 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2727 _ = alloc;
2828 var it = std.mem.tokenize(u8, line, "; ");
2929 var n = it.next().?;
......@@ -33,6 +33,5 @@ pub usingnamespace common.Main(struct {
3333 n = std.mem.trimRight(u8, n, "'");
3434
3535 try writer.print(" .{{ .number = {s}, .simplified = {}, .character = 0x{s}, .ideograph = 0x{s} }},\n", .{ n, s, c, i });
36 return true;
3736 }
3837});
scripts/CaseFolding.zig+1-2
......@@ -36,7 +36,7 @@ pub usingnamespace common.Main(struct {
3636 \\
3737 ;
3838
39 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
39 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
4040 _ = alloc;
4141 var it = std.mem.split(u8, line, "; ");
4242 const code = it.next().?;
......@@ -61,6 +61,5 @@ pub usingnamespace common.Main(struct {
6161 try writer.writeAll(" } }, // ");
6262 try writer.writeAll(it.rest());
6363 try writer.writeAll("\n");
64 return true;
6564 }
6665});
scripts/CompositionExclusions.zig+1-2
......@@ -17,7 +17,7 @@ pub usingnamespace common.Main(struct {
1717 \\
1818 ;
1919
20 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
20 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2121 _ = alloc;
2222 var it = std.mem.split(u8, line, " ");
2323 try writer.print(" 0x{s}, // ", .{it.next().?});
......@@ -30,6 +30,5 @@ pub usingnamespace common.Main(struct {
3030 break;
3131 }
3232 }
33 return true;
3433 }
3534});
scripts/DerivedAge.zig+1-3
......@@ -22,7 +22,7 @@ pub usingnamespace common.Main(struct {
2222 \\
2323 ;
2424
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2626 _ = alloc;
2727 var it = std.mem.tokenize(u8, line, "; ");
2828
......@@ -41,7 +41,5 @@ pub usingnamespace common.Main(struct {
4141 const minor = jt.next().?;
4242 try writer.print(" .since = .{{ {s},{s} }} }},\n", .{ major, minor });
4343 }
44
45 return true;
4644 }
4745});
scripts/DerivedCoreProperties.zig+1-3
......@@ -42,7 +42,7 @@ pub usingnamespace common.Main(struct {
4242 \\
4343 ;
4444
45 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
45 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
4646 _ = alloc;
4747 var it = std.mem.tokenize(u8, line, "; ");
4848
......@@ -58,7 +58,5 @@ pub usingnamespace common.Main(struct {
5858 const prop = it.next().?;
5959 try writer.print(" .prop = .{s} }},\n", .{prop});
6060 }
61
62 return true;
6361 }
6462});
scripts/EastAsianWidth.zig+1-3
......@@ -22,7 +22,7 @@ pub usingnamespace common.Main(struct {
2222 \\
2323 ;
2424
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2626 _ = alloc;
2727 var it = std.mem.tokenize(u8, line, "; ");
2828
......@@ -38,7 +38,5 @@ pub usingnamespace common.Main(struct {
3838 const prop = it.next().?;
3939 try writer.print(" .prop = .{s} }},\n", .{prop});
4040 }
41
42 return true;
4341 }
4442});
scripts/EmojiSources.zig+2-4
......@@ -23,9 +23,9 @@ pub usingnamespace common.Main(struct {
2323 \\
2424 ;
2525
26 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2727 _ = alloc;
28 if (std.mem.count(u8, line, " ") > 0) return true;
28 if (std.mem.count(u8, line, " ") > 0) return;
2929 var it = std.mem.split(u8, line, ";");
3030 const code = it.next().?;
3131 // FIXME remove @as and temp vars after switch off stage1
......@@ -39,7 +39,5 @@ pub usingnamespace common.Main(struct {
3939 kddi,
4040 softbank,
4141 });
42
43 return true;
4442 }
4543});
scripts/EquivalentUnifiedIdeograph.zig+1-3
......@@ -16,7 +16,7 @@ pub usingnamespace common.Main(struct {
1616 \\
1717 ;
1818
19 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
19 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2020 _ = alloc;
2121 var it = std.mem.tokenize(u8, line, "; ");
2222
......@@ -33,7 +33,5 @@ pub usingnamespace common.Main(struct {
3333 } else {
3434 try writer.print(" .{{ 0x{s}, 0x{s} }},\n", .{ first, next });
3535 }
36
37 return true;
3836 }
3937});
scripts/HangulSyllableType.zig+1-3
......@@ -22,7 +22,7 @@ pub usingnamespace common.Main(struct {
2222 \\
2323 ;
2424
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2626 _ = alloc;
2727 var it = std.mem.tokenize(u8, line, "; ");
2828
......@@ -38,7 +38,5 @@ pub usingnamespace common.Main(struct {
3838 const prop = it.next().?;
3939 try writer.print(" .prop = .{s} }},\n", .{prop});
4040 }
41
42 return true;
4341 }
4442});
scripts/IndicPositionalCategory.zig+1-3
......@@ -37,7 +37,7 @@ pub usingnamespace common.Main(struct {
3737 \\
3838 ;
3939
40 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
40 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
4141 _ = alloc;
4242 var it = std.mem.tokenize(u8, line, "; ");
4343
......@@ -54,7 +54,5 @@ pub usingnamespace common.Main(struct {
5454 } else {
5555 try writer.print(" .{{ .code = 0x{s}, .category = .{s} }},\n", .{ first, next });
5656 }
57
58 return true;
5957 }
6058});
scripts/IndicSyllabicCategory.zig+1-3
......@@ -57,7 +57,7 @@ pub usingnamespace common.Main(struct {
5757 \\
5858 ;
5959
60 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
60 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
6161 _ = alloc;
6262 var it = std.mem.tokenize(u8, line, "; ");
6363
......@@ -74,7 +74,5 @@ pub usingnamespace common.Main(struct {
7474 } else {
7575 try writer.print(" .{{ .code = 0x{s}, .category = .{s} }},\n", .{ first, next });
7676 }
77
78 return true;
7977 }
8078});
scripts/Jamo.zig+1-3
......@@ -21,7 +21,7 @@ pub usingnamespace common.Main(struct {
2121 \\
2222 ;
2323
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2525 _ = alloc;
2626 var it = std.mem.tokenize(u8, line, "; ");
2727
......@@ -30,7 +30,5 @@ pub usingnamespace common.Main(struct {
3030 const actual = if (std.mem.eql(u8, next, "#")) "" else next;
3131
3232 try writer.print(" .{{ .code = 0x{s}, .short_name = \"{}\" }},\n", .{ first, std.zig.fmtEscapes(actual) });
33
34 return true;
3533 }
3634});
scripts/NameAliases.zig+1-3
......@@ -28,7 +28,7 @@ pub usingnamespace common.Main(struct {
2828 \\
2929 ;
3030
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
3232 _ = alloc;
3333 var it = std.mem.split(u8, line, ";");
3434
......@@ -37,7 +37,5 @@ pub usingnamespace common.Main(struct {
3737 std.zig.fmtEscapes(it.next().?),
3838 it.next().?,
3939 });
40
41 return true;
4240 }
4341});
scripts/NamedSequences.zig+1-3
......@@ -21,7 +21,7 @@ pub usingnamespace common.Main(struct {
2121 \\
2222 ;
2323
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2525 _ = alloc;
2626 var it = std.mem.split(u8, line, ";");
2727
......@@ -32,7 +32,5 @@ pub usingnamespace common.Main(struct {
3232 try writer.print(" 0x{s},", .{jtem});
3333 }
3434 try writer.writeAll(" } },\n");
35
36 return true;
3735 }
3836});
scripts/NamedSequencesProv.zig+1-3
......@@ -21,7 +21,7 @@ pub usingnamespace common.Main(struct {
2121 \\
2222 ;
2323
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2525 _ = alloc;
2626 var it = std.mem.split(u8, line, ";");
2727
......@@ -32,7 +32,5 @@ pub usingnamespace common.Main(struct {
3232 try writer.print(" 0x{s},", .{jtem});
3333 }
3434 try writer.writeAll(" } },\n");
35
36 return true;
3735 }
3836});
scripts/PropertyAliases.zig+1-3
......@@ -21,7 +21,7 @@ pub usingnamespace common.Main(struct {
2121 \\};
2222 ;
2323
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
24 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
2525 _ = alloc;
2626 var it = std.mem.tokenize(u8, line, "; ");
2727
......@@ -29,7 +29,5 @@ pub usingnamespace common.Main(struct {
2929 std.zig.fmtEscapes(it.next().?),
3030 std.zig.fmtEscapes(it.next().?),
3131 });
32
33 return true;
3432 }
3533});
scripts/ScriptExtensions.zig+1-3
......@@ -87,7 +87,7 @@ pub usingnamespace common.Main(struct {
8787 \\
8888 ;
8989
90 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
90 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
9191 _ = alloc;
9292 var it = std.mem.tokenize(u8, line, "; ");
9393
......@@ -103,8 +103,6 @@ pub usingnamespace common.Main(struct {
103103 } else {
104104 try writer.print(" .{{ .code = 0x{s}, .scripts = {} }},\n", .{ first, fmtScripts(untilComment(it.rest())) });
105105 }
106
107 return true;
108106 }
109107});
110108
scripts/_common.zig+2-6
......@@ -64,9 +64,7 @@ pub fn Main(comptime T: type) type {
6464 continue;
6565 }
6666
67 if (!(try T.exec(arena.allocator(), line, w))) {
68 break;
69 }
67 try T.exec(arena.allocator(), line, w);
7068
7169 std.debug.print("{s}", .{ansi.csi.CursorUp(1)});
7270 std.debug.print("{s}", .{ansi.csi.EraseInLine(0)});
......@@ -85,7 +83,7 @@ pub fn nullify(input: []const u8) ?[]const u8 {
8583
8684pub fn RangeEnum(comptime prop: []const u8) type {
8785 return struct {
88 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
86 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !void {
8987 _ = alloc;
9088 var it = std.mem.tokenize(u8, line, "; ");
9189
......@@ -99,8 +97,6 @@ pub fn RangeEnum(comptime prop: []const u8) type {
9997 } else {
10098 try writer.print(" .{{ .from = 0x{s}, .to = 0x{s}, .{s} = .{s} }},\n", .{ first, first, prop, next });
10199 }
102
103 return true;
104100 }
105101 };
106102}