authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-18 15:46:41 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-18 15:46:41 -08:00
loge9232e16f02033a172fea77909657fb75e7be00d
tree29a53b899dca4d8ffd17add224980c3ee1278b4f
parent8fa1d3cfbd3434477eff1ee5cfd9fc0612bf1dc4

update for zig master


5 files changed, 15 insertions(+), 10 deletions(-)

scripts/_common.zig+3-3
......@@ -12,7 +12,7 @@ pub fn Main(comptime T: type) type {
1212 return struct {
1313 pub fn do() !void {
1414 var gpa = std.heap.GeneralPurposeAllocator(.{}){};
15 const alloc = &gpa.allocator;
15 const alloc = gpa.allocator();
1616 defer _ = gpa.deinit();
1717
1818 const max_size = std.math.maxInt(usize);
......@@ -41,7 +41,7 @@ pub fn Main(comptime T: type) type {
4141 var line_num: usize = 1;
4242 std.debug.print("\n", .{});
4343
44 const arena = &std.heap.ArenaAllocator.init(alloc);
44 var arena = std.heap.ArenaAllocator.init(alloc);
4545 defer arena.deinit();
4646 while (true) {
4747 const line = r.readUntilDelimiterAlloc(alloc, '\n', max_size) catch |e| if (e == error.EndOfStream) break else return e;
......@@ -54,7 +54,7 @@ pub fn Main(comptime T: type) type {
5454 continue;
5555 }
5656
57 if (!(try T.exec(&arena.allocator, line, w))) {
57 if (!(try T.exec(arena.allocator(), line, w))) {
5858 break;
5959 }
6060
scripts/arabic_shaping.zig+2-2
......@@ -139,8 +139,8 @@ pub const default = common.Main(struct {
139139 \\
140140 ;
141141
142 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {
143 var it = std.mem.split(line, ";");
142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
143 var it = std.mem.split(u8, line, ";");
144144 const c = std.mem.trim(u8, it.next().?, " ");
145145 const n = std.mem.trim(u8, it.next().?, " ");
146146 const t = std.mem.trim(u8, it.next().?, " ");
scripts/bidi_brackets.zig+4-2
......@@ -28,8 +28,10 @@ pub const default = common.Main(struct {
2828 \\
2929 ;
3030
31 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {
32 var it = std.mem.split(line, ";");
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, ";");
3335 const a = std.mem.trim(u8, it.next().?, " ");
3436 const b = std.mem.trim(u8, it.next().?, " ");
3537 const c = std.mem.trim(u8, it.next().?, " ");
scripts/blocks.zig+5-3
......@@ -22,9 +22,11 @@ pub const default = common.Main(struct {
2222 \\
2323 ;
2424
25 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 var it1 = std.mem.split(line, "; ");
27 var it2 = std.mem.split(it1.next().?, "..");
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().?, "..");
2830 const from = it2.next().?;
2931 const to = it2.next().?;
3032 const name = it1.next().?;
zig.mod+1
......@@ -4,6 +4,7 @@ main: src/lib.zig
44license: MIT
55description: Zig bindings for the Unicode Character Database
66root_dependencies:
7 - src: git https://github.com/nektro/iguanaTLS
78 - src: git https://github.com/truemedian/zfetch
89 - src: git https://github.com/nektro/zig-ansi
910 - src: git https://github.com/nektro/zig-fmt-valueliteral