authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-21 13:10:08 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-21 13:10:08 -08:00
log0a163878eec9c3a75bf055562102c627d07ae572
tree8e0b8beded846b715543532ff9eb57bcb0bb1bfe
parent5062f741b00f3e7ff5a505c83d2332e99f462ea5

properly capitalize generate scripts


7 files changed, 238 insertions(+), 238 deletions(-)

generate.zig+3-3
...@@ -1,9 +1,9 @@...@@ -1,9 +1,9 @@
1const std = @import("std");1const std = @import("std");
22
3const files = [_]type{3const files = [_]type{
4 @import("./scripts/blocks.zig"),4 @import("./scripts/Blocks.zig"),
5 @import("./scripts/arabic_shaping.zig"),5 @import("./scripts/ArabicShaping.zig"),
6 @import("./scripts/bidi_brackets.zig"),6 @import("./scripts/BidiBrackets.zig"),
7 @import("./scripts/BidiMirroring.zig"),7 @import("./scripts/BidiMirroring.zig"),
8 @import("./scripts/CJKRadicals.zig"),8 @import("./scripts/CJKRadicals.zig"),
9 @import("./scripts/CaseFolding.zig"),9 @import("./scripts/CaseFolding.zig"),
scripts/ArabicShaping.zig created+156
...@@ -0,0 +1,156 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "ArabicShaping";
6
7 pub const dest_file = "src/arabic_shaping.zig";
8
9 pub const dest_header =
10 \\pub const Shaping = struct {
11 \\ codepoint: u21,
12 \\ schematic_name: []const u8,
13 \\ joining_type: Joining.Type,
14 \\ joining_group: Joining.Group,
15 \\};
16 \\
17 \\pub const Joining = struct {
18 \\ pub const Type = enum {
19 \\ U,
20 \\ D,
21 \\ R,
22 \\ C,
23 \\ T,
24 \\ L,
25 \\ };
26 \\
27 \\ pub const Group = enum {
28 \\ No_Joining_Group,
29 \\ YEH,
30 \\ ALEF,
31 \\ WAW,
32 \\ BEH,
33 \\ TEH_MARBUTA,
34 \\ HAH,
35 \\ DAL,
36 \\ REH,
37 \\ SEEN,
38 \\ SAD,
39 \\ TAH,
40 \\ AIN,
41 \\ GAF,
42 \\ FARSI_YEH,
43 \\ FEH,
44 \\ QAF,
45 \\ KAF,
46 \\ LAM,
47 \\ MEEM,
48 \\ NOON,
49 \\ HEH,
50 \\ SWASH_KAF,
51 \\ NYA,
52 \\ KNOTTED_HEH,
53 \\ HEH_GOAL,
54 \\ TEH_MARBUTA_GOAL,
55 \\ YEH_WITH_TAIL,
56 \\ YEH_BARREE,
57 \\ ALAPH,
58 \\ BETH,
59 \\ GAMAL,
60 \\ DALATH_RISH,
61 \\ HE,
62 \\ SYRIAC_WAW,
63 \\ ZAIN,
64 \\ HETH,
65 \\ TETH,
66 \\ YUDH,
67 \\ YUDH_HE,
68 \\ KAPH,
69 \\ LAMADH,
70 \\ MIM,
71 \\ NUN,
72 \\ SEMKATH,
73 \\ FINAL_SEMKATH,
74 \\ E,
75 \\ PE,
76 \\ REVERSED_PE,
77 \\ SADHE,
78 \\ QAPH,
79 \\ SHIN,
80 \\ TAW,
81 \\ ZHAIN,
82 \\ KHAPH,
83 \\ FE,
84 \\ BURUSHASKI_YEH_BARREE,
85 \\ MALAYALAM_NGA,
86 \\ MALAYALAM_JA,
87 \\ MALAYALAM_NYA,
88 \\ MALAYALAM_TTA,
89 \\ MALAYALAM_NNA,
90 \\ MALAYALAM_NNNA,
91 \\ MALAYALAM_BHA,
92 \\ MALAYALAM_RA,
93 \\ MALAYALAM_LLA,
94 \\ MALAYALAM_LLLA,
95 \\ MALAYALAM_SSA,
96 \\ ROHINGYA_YEH,
97 \\ STRAIGHT_WAW,
98 \\ AFRICAN_FEH,
99 \\ AFRICAN_QAF,
100 \\ AFRICAN_NOON,
101 \\ MANICHAEAN_ALEPH,
102 \\ MANICHAEAN_BETH,
103 \\ MANICHAEAN_GIMEL,
104 \\ MANICHAEAN_DALETH,
105 \\ MANICHAEAN_WAW,
106 \\ MANICHAEAN_ZAYIN,
107 \\ MANICHAEAN_HETH,
108 \\ MANICHAEAN_TETH,
109 \\ MANICHAEAN_YODH,
110 \\ MANICHAEAN_KAPH,
111 \\ MANICHAEAN_LAMEDH,
112 \\ MANICHAEAN_DHAMEDH,
113 \\ MANICHAEAN_THAMEDH,
114 \\ MANICHAEAN_MEM,
115 \\ MANICHAEAN_NUN,
116 \\ MANICHAEAN_SAMEKH,
117 \\ MANICHAEAN_AYIN,
118 \\ MANICHAEAN_PE,
119 \\ MANICHAEAN_SADHE,
120 \\ MANICHAEAN_QOPH,
121 \\ MANICHAEAN_RESH,
122 \\ MANICHAEAN_TAW,
123 \\ MANICHAEAN_ONE,
124 \\ MANICHAEAN_FIVE,
125 \\ MANICHAEAN_TEN,
126 \\ MANICHAEAN_TWENTY,
127 \\ MANICHAEAN_HUNDRED,
128 \\ HANIFI_ROHINGYA_PA,
129 \\ HANIFI_ROHINGYA_KINNA_YA,
130 \\ };
131 \\};
132 \\
133 \\pub const data = [_]Shaping{
134 \\
135 ;
136
137 pub const dest_footer =
138 \\};
139 \\
140 ;
141
142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
143 var it = std.mem.split(u8, line, ";");
144 const c = std.mem.trim(u8, it.next().?, " ");
145 const n = std.mem.trim(u8, it.next().?, " ");
146 const t = std.mem.trim(u8, it.next().?, " ");
147 const g = std.mem.trim(u8, it.next().?, " ");
148 const g2 = try std.mem.replaceOwned(u8, alloc, g, " ", "_");
149
150 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Type, t);
151 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Group, g2);
152
153 try writer.print(" .{{ .codepoint = 0x{s}, .schematic_name = \"{s}\", .joining_type = .{s}, .joining_group = .{s} }},\n", .{ c, n, t, g2 });
154 return true;
155 }
156});
scripts/BidiBrackets.zig created+42
...@@ -0,0 +1,42 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "BidiBrackets";
6
7 pub const dest_file = "src/bidi_brackets.zig";
8
9 pub const dest_header =
10 \\pub const BracketPairing = struct {
11 \\ codepoint: u21,
12 \\ pair: u21,
13 \\ type: Type,
14 \\
15 \\ pub const Type = enum {
16 \\ o,
17 \\ c,
18 \\ n,
19 \\ };
20 \\};
21 \\
22 \\pub const data = [_]BracketPairing{
23 \\
24 ;
25
26 pub const dest_footer =
27 \\};
28 \\
29 ;
30
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
32 _ = alloc;
33
34 var it = std.mem.split(u8, line, ";");
35 const a = std.mem.trim(u8, it.next().?, " ");
36 const b = std.mem.trim(u8, it.next().?, " ");
37 const c = std.mem.trim(u8, it.next().?, " ");
38
39 try writer.print(" .{{ .codepoint = 0x{s}, .pair = 0x{s}, .type = .{s} }}, // {s}\n", .{ a, b, c[0..1], c[4..] });
40 return true;
41 }
42});
scripts/Blocks.zig created+37
...@@ -0,0 +1,37 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "Blocks";
6
7 pub const dest_file = "src/blocks.zig";
8
9 pub const dest_header =
10 \\pub const Block = struct {
11 \\ from: u21,
12 \\ to: u21,
13 \\ name: []const u8,
14 \\};
15 \\
16 \\pub const data = [_]Block{
17 \\
18 ;
19
20 pub const dest_footer =
21 \\};
22 \\
23 ;
24
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 _ = alloc;
27
28 var it1 = std.mem.split(u8, line, "; ");
29 var it2 = std.mem.split(u8, it1.next().?, "..");
30 const from = it2.next().?;
31 const to = it2.next().?;
32 const name = it1.next().?;
33
34 try writer.print(" .{{ .from = 0x{s}, .to = 0x{s}, .name = \"{s}\" }},\n", .{ from, to, name });
35 return true;
36 }
37});
scripts/arabic_shaping.zig deleted-156
...@@ -1,156 +0,0 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "ArabicShaping";
6
7 pub const dest_file = "src/arabic_shaping.zig";
8
9 pub const dest_header =
10 \\pub const Shaping = struct {
11 \\ codepoint: u21,
12 \\ schematic_name: []const u8,
13 \\ joining_type: Joining.Type,
14 \\ joining_group: Joining.Group,
15 \\};
16 \\
17 \\pub const Joining = struct {
18 \\ pub const Type = enum {
19 \\ U,
20 \\ D,
21 \\ R,
22 \\ C,
23 \\ T,
24 \\ L,
25 \\ };
26 \\
27 \\ pub const Group = enum {
28 \\ No_Joining_Group,
29 \\ YEH,
30 \\ ALEF,
31 \\ WAW,
32 \\ BEH,
33 \\ TEH_MARBUTA,
34 \\ HAH,
35 \\ DAL,
36 \\ REH,
37 \\ SEEN,
38 \\ SAD,
39 \\ TAH,
40 \\ AIN,
41 \\ GAF,
42 \\ FARSI_YEH,
43 \\ FEH,
44 \\ QAF,
45 \\ KAF,
46 \\ LAM,
47 \\ MEEM,
48 \\ NOON,
49 \\ HEH,
50 \\ SWASH_KAF,
51 \\ NYA,
52 \\ KNOTTED_HEH,
53 \\ HEH_GOAL,
54 \\ TEH_MARBUTA_GOAL,
55 \\ YEH_WITH_TAIL,
56 \\ YEH_BARREE,
57 \\ ALAPH,
58 \\ BETH,
59 \\ GAMAL,
60 \\ DALATH_RISH,
61 \\ HE,
62 \\ SYRIAC_WAW,
63 \\ ZAIN,
64 \\ HETH,
65 \\ TETH,
66 \\ YUDH,
67 \\ YUDH_HE,
68 \\ KAPH,
69 \\ LAMADH,
70 \\ MIM,
71 \\ NUN,
72 \\ SEMKATH,
73 \\ FINAL_SEMKATH,
74 \\ E,
75 \\ PE,
76 \\ REVERSED_PE,
77 \\ SADHE,
78 \\ QAPH,
79 \\ SHIN,
80 \\ TAW,
81 \\ ZHAIN,
82 \\ KHAPH,
83 \\ FE,
84 \\ BURUSHASKI_YEH_BARREE,
85 \\ MALAYALAM_NGA,
86 \\ MALAYALAM_JA,
87 \\ MALAYALAM_NYA,
88 \\ MALAYALAM_TTA,
89 \\ MALAYALAM_NNA,
90 \\ MALAYALAM_NNNA,
91 \\ MALAYALAM_BHA,
92 \\ MALAYALAM_RA,
93 \\ MALAYALAM_LLA,
94 \\ MALAYALAM_LLLA,
95 \\ MALAYALAM_SSA,
96 \\ ROHINGYA_YEH,
97 \\ STRAIGHT_WAW,
98 \\ AFRICAN_FEH,
99 \\ AFRICAN_QAF,
100 \\ AFRICAN_NOON,
101 \\ MANICHAEAN_ALEPH,
102 \\ MANICHAEAN_BETH,
103 \\ MANICHAEAN_GIMEL,
104 \\ MANICHAEAN_DALETH,
105 \\ MANICHAEAN_WAW,
106 \\ MANICHAEAN_ZAYIN,
107 \\ MANICHAEAN_HETH,
108 \\ MANICHAEAN_TETH,
109 \\ MANICHAEAN_YODH,
110 \\ MANICHAEAN_KAPH,
111 \\ MANICHAEAN_LAMEDH,
112 \\ MANICHAEAN_DHAMEDH,
113 \\ MANICHAEAN_THAMEDH,
114 \\ MANICHAEAN_MEM,
115 \\ MANICHAEAN_NUN,
116 \\ MANICHAEAN_SAMEKH,
117 \\ MANICHAEAN_AYIN,
118 \\ MANICHAEAN_PE,
119 \\ MANICHAEAN_SADHE,
120 \\ MANICHAEAN_QOPH,
121 \\ MANICHAEAN_RESH,
122 \\ MANICHAEAN_TAW,
123 \\ MANICHAEAN_ONE,
124 \\ MANICHAEAN_FIVE,
125 \\ MANICHAEAN_TEN,
126 \\ MANICHAEAN_TWENTY,
127 \\ MANICHAEAN_HUNDRED,
128 \\ HANIFI_ROHINGYA_PA,
129 \\ HANIFI_ROHINGYA_KINNA_YA,
130 \\ };
131 \\};
132 \\
133 \\pub const data = [_]Shaping{
134 \\
135 ;
136
137 pub const dest_footer =
138 \\};
139 \\
140 ;
141
142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
143 var it = std.mem.split(u8, line, ";");
144 const c = std.mem.trim(u8, it.next().?, " ");
145 const n = std.mem.trim(u8, it.next().?, " ");
146 const t = std.mem.trim(u8, it.next().?, " ");
147 const g = std.mem.trim(u8, it.next().?, " ");
148 const g2 = try std.mem.replaceOwned(u8, alloc, g, " ", "_");
149
150 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Type, t);
151 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Group, g2);
152
153 try writer.print(" .{{ .codepoint = 0x{s}, .schematic_name = \"{s}\", .joining_type = .{s}, .joining_group = .{s} }},\n", .{ c, n, t, g2 });
154 return true;
155 }
156});
scripts/bidi_brackets.zig deleted-42
...@@ -1,42 +0,0 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "BidiBrackets";
6
7 pub const dest_file = "src/bidi_brackets.zig";
8
9 pub const dest_header =
10 \\pub const BracketPairing = struct {
11 \\ codepoint: u21,
12 \\ pair: u21,
13 \\ type: Type,
14 \\
15 \\ pub const Type = enum {
16 \\ o,
17 \\ c,
18 \\ n,
19 \\ };
20 \\};
21 \\
22 \\pub const data = [_]BracketPairing{
23 \\
24 ;
25
26 pub const dest_footer =
27 \\};
28 \\
29 ;
30
31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
32 _ = alloc;
33
34 var it = std.mem.split(u8, line, ";");
35 const a = std.mem.trim(u8, it.next().?, " ");
36 const b = std.mem.trim(u8, it.next().?, " ");
37 const c = std.mem.trim(u8, it.next().?, " ");
38
39 try writer.print(" .{{ .codepoint = 0x{s}, .pair = 0x{s}, .type = .{s} }}, // {s}\n", .{ a, b, c[0..1], c[4..] });
40 return true;
41 }
42});
scripts/blocks.zig deleted-37
...@@ -1,37 +0,0 @@
1const std = @import("std");
2const common = @import("./_common.zig");
3
4pub usingnamespace common.Main(struct {
5 pub const source_file = "Blocks";
6
7 pub const dest_file = "src/blocks.zig";
8
9 pub const dest_header =
10 \\pub const Block = struct {
11 \\ from: u21,
12 \\ to: u21,
13 \\ name: []const u8,
14 \\};
15 \\
16 \\pub const data = [_]Block{
17 \\
18 ;
19
20 pub const dest_footer =
21 \\};
22 \\
23 ;
24
25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 _ = alloc;
27
28 var it1 = std.mem.split(u8, line, "; ");
29 var it2 = std.mem.split(u8, it1.next().?, "..");
30 const from = it2.next().?;
31 const to = it2.next().?;
32 const name = it1.next().?;
33
34 try writer.print(" .{{ .from = 0x{s}, .to = 0x{s}, .name = \"{s}\" }},\n", .{ from, to, name });
35 return true;
36 }
37});