authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-24 02:44:03 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-24 02:44:03 -07:00
logfbd112e48048289ad2e1aed1da69328f0ffe1ecd
treee582942c91e03c9642c0ea1d5b4b1bd85943a953
parented2317992dacb4eb7354192e2e8900b95e44328f

start using nio


3 files changed, 5 insertions(+), 2 deletions(-)

intrusive_parser.zig+3-2
...@@ -1,9 +1,10 @@...@@ -1,9 +1,10 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const extras = @import("extras");3const extras = @import("extras");
4const nio = @import("nio");
45
5pub const Parser = struct {6pub const Parser = struct {
6 any: std.io.AnyReader,7 any: nio.AnyReadable,
7 allocator: std.mem.Allocator,8 allocator: std.mem.Allocator,
8 temp: std.ArrayListUnmanaged(u8) = .{},9 temp: std.ArrayListUnmanaged(u8) = .{},
9 idx: usize = 0,10 idx: usize = 0,
...@@ -14,7 +15,7 @@ pub const Parser = struct {...@@ -14,7 +15,7 @@ pub const Parser = struct {
14 strings_map: std.StringArrayHashMapUnmanaged(usize) = .{},15 strings_map: std.StringArrayHashMapUnmanaged(usize) = .{},
15 string_tag: u8,16 string_tag: u8,
1617
17 pub fn init(allocator: std.mem.Allocator, any: std.io.AnyReader, string_tag: u8) Parser {18 pub fn init(allocator: std.mem.Allocator, any: nio.AnyReadable, string_tag: u8) Parser {
18 return .{19 return .{
19 .any = any,20 .any = any,
20 .allocator = allocator,21 .allocator = allocator,
licenses.txt+1
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1MPL-2.0:1MPL-2.0:
2= https://spdx.org/licenses/MPL-2.02= https://spdx.org/licenses/MPL-2.0
3- This3- This
4- git https://github.com/nektro/zig-nio
45
5MIT:6MIT:
6= https://spdx.org/licenses/MIT7= https://spdx.org/licenses/MIT
zigmod.yml+1
...@@ -5,3 +5,4 @@ license: MPL-2.0...@@ -5,3 +5,4 @@ license: MPL-2.0
5description: Core plumbing to make text or binary document parsers with Data Oriented Design5description: Core plumbing to make text or binary document parsers with Data Oriented Design
6dependencies:6dependencies:
7 - src: git https://github.com/nektro/zig-extras7 - src: git https://github.com/nektro/zig-extras
8 - src: git https://github.com/nektro/zig-nio