From 79469e08b9920fa0b10d5e6dcc3dffc30e96928b Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Tue, 9 Jun 2026 10:45:24 +0200 Subject: cleanup --- src/zisp/io/parse.zig | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 src/zisp/io/parse.zig (limited to 'src/zisp/io/parse.zig') diff --git a/src/zisp/io/parse.zig b/src/zisp/io/parse.zig deleted file mode 100644 index 9b6d32c..0000000 --- a/src/zisp/io/parse.zig +++ /dev/null @@ -1,42 +0,0 @@ -const builtin = @import("builtin"); -const std = @import("std"); - -const Alloc = std.mem.Allocator; -const Reader = *std.Io.Reader; - -const io = @import("../io.zig"); -const value = @import("../value.zig"); - -const Parser = io.Parser; -const Value = value.Value; - -const is_test = builtin.is_test; -const is_debug = builtin.mode == .Debug; - -const ParserErrors = error{ - ParseError, - OutOfMemory, -}; - -pub fn fromReader(alloc: Alloc, input: Reader) ParserErrors!Value { - var p = try Parser.init(alloc); - defer p.deinit(); - return p.run(input); -} - -pub fn fromReaderNoError(alloc: Alloc, input: Reader) Value { - var p = Parser.init(alloc) catch @panic("OOM"); - defer p.deinit(); - return p.run(input) catch |e| switch (e) { - error.OutOfMemory => @panic("OOM"), - error.ParseError => { - const format = "Parse error: {s}, unread_char: {s}\n"; - const unread: [4]u8 = - if (p.unread_char) |c| - "0x".* ++ std.fmt.hex(c) - else - "none".*; - std.debug.panic(format, .{ p.err_msg, unread }); - }, - }; -} -- cgit v1.2.3