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");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/bidi_mirroring.zig";7 pub const dest_file = "src/bidi_mirroring.zig";
88
scripts/CJKRadicals.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/cjk_radicals.zig";7 pub const dest_file = "src/cjk_radicals.zig";
88
scripts/CaseFolding.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/case_folding.zig";7 pub const dest_file = "src/case_folding.zig";
88
scripts/_common.zig+4-3
...@@ -6,7 +6,7 @@ const ansi = @import("ansi");...@@ -6,7 +6,7 @@ const ansi = @import("ansi");
6pub const version = "13.0.0";6pub const version = "13.0.0";
77
8pub fn Main(comptime T: type) type {8pub fn Main(comptime T: type) type {
9 comptime std.debug.assert(@hasDecl(T, "source_url"));9 comptime std.debug.assert(@hasDecl(T, "source_file"));
10 comptime std.debug.assert(@hasDecl(T, "dest_file"));10 comptime std.debug.assert(@hasDecl(T, "dest_file"));
11 comptime std.debug.assert(@hasDecl(T, "dest_header"));11 comptime std.debug.assert(@hasDecl(T, "dest_header"));
12 comptime std.debug.assert(@hasDecl(T, "dest_footer"));12 comptime std.debug.assert(@hasDecl(T, "dest_footer"));
...@@ -18,6 +18,7 @@ pub fn Main(comptime T: type) type {...@@ -18,6 +18,7 @@ pub fn Main(comptime T: type) type {
18 defer _ = gpa.deinit();18 defer _ = gpa.deinit();
1919
20 const max_size = std.math.maxInt(usize);20 const max_size = std.math.maxInt(usize);
21 const source_url = "https://unicode.org/Public/" ++ version ++ "/ucd/" ++ T.source_file ++ ".txt";
2122
22 //23 //
23 std.log.info("{s}", .{T.dest_file});24 std.log.info("{s}", .{T.dest_file});
...@@ -39,10 +40,10 @@ pub fn Main(comptime T: type) type {...@@ -39,10 +40,10 @@ pub fn Main(comptime T: type) type {
39 \\// zig fmt: off40 \\// zig fmt: off
40 \\41 \\
41 \\42 \\
42 , .{T.source_url});43 , .{source_url});
43 try w.writeAll(T.dest_header);44 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);
46 defer req.deinit();47 defer req.deinit();
47 try req.do(.GET, null, null);48 try req.do(.GET, null, null);
48 const r = req.reader();49 const r = req.reader();
scripts/arabic_shaping.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/arabic_shaping.zig";7 pub const dest_file = "src/arabic_shaping.zig";
88
scripts/bidi_brackets.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/bidi_brackets.zig";7 pub const dest_file = "src/bidi_brackets.zig";
88
scripts/blocks.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const common = @import("./_common.zig");2const common = @import("./_common.zig");
33
4pub usingnamespace common.Main(struct {4pub 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
7 pub const dest_file = "src/blocks.zig";7 pub const dest_file = "src/blocks.zig";
88