authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-21 13:07:48 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-21 13:07:48 -08:00
log5062f741b00f3e7ff5a505c83d2332e99f462ea5
tree476feb7e0d55d207cd1e8b9e90627158c64881ff
parent49454115db3958db0157a13a059a3d7a76e19636

only construct source_url in _common


7 files changed, 10 insertions(+), 9 deletions(-)

scripts/BidiMirroring.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/BidiMirroring.txt";
5 pub const source_file = "BidiMirroring";
66
77 pub const dest_file = "src/bidi_mirroring.zig";
88
scripts/CJKRadicals.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/CJKRadicals.txt";
5 pub const source_file = "CJKRadicals";
66
77 pub const dest_file = "src/cjk_radicals.zig";
88
scripts/CaseFolding.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/CaseFolding.txt";
5 pub const source_file = "CaseFolding";
66
77 pub const dest_file = "src/case_folding.zig";
88
scripts/_common.zig+4-3
......@@ -6,7 +6,7 @@ const ansi = @import("ansi");
66pub const version = "13.0.0";
77
88pub fn Main(comptime T: type) type {
9 comptime std.debug.assert(@hasDecl(T, "source_url"));
9 comptime std.debug.assert(@hasDecl(T, "source_file"));
1010 comptime std.debug.assert(@hasDecl(T, "dest_file"));
1111 comptime std.debug.assert(@hasDecl(T, "dest_header"));
1212 comptime std.debug.assert(@hasDecl(T, "dest_footer"));
......@@ -18,6 +18,7 @@ pub fn Main(comptime T: type) type {
1818 defer _ = gpa.deinit();
1919
2020 const max_size = std.math.maxInt(usize);
21 const source_url = "https://unicode.org/Public/" ++ version ++ "/ucd/" ++ T.source_file ++ ".txt";
2122
2223 //
2324 std.log.info("{s}", .{T.dest_file});
......@@ -39,10 +40,10 @@ pub fn Main(comptime T: type) type {
3940 \\// zig fmt: off
4041 \\
4142 \\
42 , .{T.source_url});
43 , .{source_url});
4344 try w.writeAll(T.dest_header);
4445
45 const req = try zfetch.Request.init(alloc, T.source_url, null);
46 const req = try zfetch.Request.init(alloc, source_url, null);
4647 defer req.deinit();
4748 try req.do(.GET, null, null);
4849 const r = req.reader();
scripts/arabic_shaping.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/ArabicShaping.txt";
5 pub const source_file = "ArabicShaping";
66
77 pub const dest_file = "src/arabic_shaping.zig";
88
scripts/bidi_brackets.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/BidiBrackets.txt";
5 pub const source_file = "BidiBrackets";
66
77 pub const dest_file = "src/bidi_brackets.zig";
88
scripts/blocks.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const common = @import("./_common.zig");
33
44pub usingnamespace common.Main(struct {
5 pub const source_url = "https://unicode.org/Public/" ++ common.version ++ "/ucd/Blocks.txt";
5 pub const source_file = "Blocks";
66
77 pub const dest_file = "src/blocks.zig";
88