authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-31 12:19:43 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-31 12:19:43 -07:00
logb8b77c64430dbdd107920dfa6b01d132031648e1
tree3ae9f46d2fb91fd03b5f851f0698d3684f2e3b7d
parentaf185fe4e1496189fd90f6649f133ae171eadd96

gen- move all file header to common


2 files changed, 8 insertions(+), 4 deletions(-)

generate.zig+1-4
...@@ -3,16 +3,13 @@ const std = @import("std");...@@ -3,16 +3,13 @@ const std = @import("std");
3const common = @import("scripts/_common.zig");3const common = @import("scripts/_common.zig");
44
5pub fn main() !void {5pub fn main() !void {
6 // Blocks
6 try common.Main(struct {7 try common.Main(struct {
7 pub const source_url = "https://unicode.org/Public/UCD/latest/ucd/Blocks.txt";8 pub const source_url = "https://unicode.org/Public/UCD/latest/ucd/Blocks.txt";
89
9 pub const dest_file = "src/blocks.zig";10 pub const dest_file = "src/blocks.zig";
1011
11 pub const dest_header =12 pub const dest_header =
12 \\// This file is part of the Unicode Character Database
13 \\// See http://www.unicode.org/reports/tr44/ for more information.
14 \\//
15 \\
16 \\pub const Block = struct {13 \\pub const Block = struct {
17 \\ from: u21,14 \\ from: u21,
18 \\ to: u21,15 \\ to: u21,
scripts/_common.zig+7
...@@ -22,6 +22,13 @@ pub fn Main(comptime T: type) type {...@@ -22,6 +22,13 @@ pub fn Main(comptime T: type) type {
22 defer file.close();22 defer file.close();
23 const w = file.writer();23 const w = file.writer();
2424
25 try w.writeAll(
26 \\// This file is part of the Unicode Character Database
27 \\// See http://www.unicode.org/reports/tr44/ for more information.
28 \\//
29 \\
30 \\
31 );
25 try w.writeAll(T.dest_header);32 try w.writeAll(T.dest_header);
2633
27 const req = try zfetch.Request.init(alloc, T.source_url, null);34 const req = try zfetch.Request.init(alloc, T.source_url, null);