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 {...@@ -12,7 +12,7 @@ pub fn Main(comptime T: type) type {
12 return struct {12 return struct {
13 pub fn do() !void {13 pub fn do() !void {
14 var gpa = std.heap.GeneralPurposeAllocator(.{}){};14 var gpa = std.heap.GeneralPurposeAllocator(.{}){};
15 const alloc = &gpa.allocator;15 const alloc = gpa.allocator();
16 defer _ = gpa.deinit();16 defer _ = gpa.deinit();
1717
18 const max_size = std.math.maxInt(usize);18 const max_size = std.math.maxInt(usize);
...@@ -41,7 +41,7 @@ pub fn Main(comptime T: type) type {...@@ -41,7 +41,7 @@ pub fn Main(comptime T: type) type {
41 var line_num: usize = 1;41 var line_num: usize = 1;
42 std.debug.print("\n", .{});42 std.debug.print("\n", .{});
4343
44 const arena = &std.heap.ArenaAllocator.init(alloc);44 var arena = std.heap.ArenaAllocator.init(alloc);
45 defer arena.deinit();45 defer arena.deinit();
46 while (true) {46 while (true) {
47 const line = r.readUntilDelimiterAlloc(alloc, '\n', max_size) catch |e| if (e == error.EndOfStream) break else return e;47 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 {...@@ -54,7 +54,7 @@ pub fn Main(comptime T: type) type {
54 continue;54 continue;
55 }55 }
5656
57 if (!(try T.exec(&arena.allocator, line, w))) {57 if (!(try T.exec(arena.allocator(), line, w))) {
58 break;58 break;
59 }59 }
6060
scripts/arabic_shaping.zig+2-2
...@@ -139,8 +139,8 @@ pub const default = common.Main(struct {...@@ -139,8 +139,8 @@ pub const default = common.Main(struct {
139 \\139 \\
140 ;140 ;
141141
142 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {142 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
143 var it = std.mem.split(line, ";");143 var it = std.mem.split(u8, line, ";");
144 const c = std.mem.trim(u8, it.next().?, " ");144 const c = std.mem.trim(u8, it.next().?, " ");
145 const n = std.mem.trim(u8, it.next().?, " ");145 const n = std.mem.trim(u8, it.next().?, " ");
146 const t = std.mem.trim(u8, it.next().?, " ");146 const t = std.mem.trim(u8, it.next().?, " ");
scripts/bidi_brackets.zig+4-2
...@@ -28,8 +28,10 @@ pub const default = common.Main(struct {...@@ -28,8 +28,10 @@ pub const default = common.Main(struct {
28 \\28 \\
29 ;29 ;
3030
31 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {31 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
32 var it = std.mem.split(line, ";");32 _ = alloc;
33
34 var it = std.mem.split(u8, line, ";");
33 const a = std.mem.trim(u8, it.next().?, " ");35 const a = std.mem.trim(u8, it.next().?, " ");
34 const b = std.mem.trim(u8, it.next().?, " ");36 const b = std.mem.trim(u8, it.next().?, " ");
35 const c = std.mem.trim(u8, it.next().?, " ");37 const c = std.mem.trim(u8, it.next().?, " ");
scripts/blocks.zig+5-3
...@@ -22,9 +22,11 @@ pub const default = common.Main(struct {...@@ -22,9 +22,11 @@ pub const default = common.Main(struct {
22 \\22 \\
23 ;23 ;
2424
25 pub fn exec(alloc: *std.mem.Allocator, line: []const u8, writer: anytype) !bool {25 pub fn exec(alloc: std.mem.Allocator, line: []const u8, writer: anytype) !bool {
26 var it1 = std.mem.split(line, "; ");26 _ = alloc;
27 var it2 = std.mem.split(it1.next().?, "..");27
28 var it1 = std.mem.split(u8, line, "; ");
29 var it2 = std.mem.split(u8, it1.next().?, "..");
28 const from = it2.next().?;30 const from = it2.next().?;
29 const to = it2.next().?;31 const to = it2.next().?;
30 const name = it1.next().?;32 const name = it1.next().?;
zig.mod+1
...@@ -4,6 +4,7 @@ main: src/lib.zig...@@ -4,6 +4,7 @@ main: src/lib.zig
4license: MIT4license: MIT
5description: Zig bindings for the Unicode Character Database5description: Zig bindings for the Unicode Character Database
6root_dependencies:6root_dependencies:
7 - src: git https://github.com/nektro/iguanaTLS
7 - src: git https://github.com/truemedian/zfetch8 - src: git https://github.com/truemedian/zfetch
8 - src: git https://github.com/nektro/zig-ansi9 - src: git https://github.com/nektro/zig-ansi
9 - src: git https://github.com/nektro/zig-fmt-valueliteral10 - src: git https://github.com/nektro/zig-fmt-valueliteral