diff --git a/generate.zig b/generate.zig index 9da2846d872c853149d3de854e4299b297b903b5..1019499b45d95c883e1fade08cbe122a3b286c19 100644 --- a/generate.zig +++ b/generate.zig @@ -3,16 +3,13 @@ const std = @import("std"); const common = @import("scripts/_common.zig"); pub fn main() !void { + // Blocks try common.Main(struct { pub const source_url = "https://unicode.org/Public/UCD/latest/ucd/Blocks.txt"; pub const dest_file = "src/blocks.zig"; pub const dest_header = - \\// This file is part of the Unicode Character Database - \\// See http://www.unicode.org/reports/tr44/ for more information. - \\// - \\ \\pub const Block = struct { \\ from: u21, \\ to: u21, diff --git a/scripts/_common.zig b/scripts/_common.zig index 8cf285f9959463abf51a24b275c54e96531b7998..7072d11d3c253b0af41f2b0c4969bfbfd7f4351e 100644 --- a/scripts/_common.zig +++ b/scripts/_common.zig @@ -22,6 +22,13 @@ pub fn Main(comptime T: type) type { defer file.close(); const w = file.writer(); + try w.writeAll( + \\// This file is part of the Unicode Character Database + \\// See http://www.unicode.org/reports/tr44/ for more information. + \\// + \\ + \\ + ); try w.writeAll(T.dest_header); const req = try zfetch.Request.init(alloc, T.source_url, null);