summaryrefslogtreecommitdiff
path: root/src/libzisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libzisp')
-rw-r--r--src/libzisp/parser.zig (renamed from src/libzisp/read.zig)7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libzisp/read.zig b/src/libzisp/parser.zig
index 74ae51b..9e70614 100644
--- a/src/libzisp/read.zig
+++ b/src/libzisp/parser.zig
@@ -253,7 +253,7 @@ const Next = enum {
finish,
};
-pub fn read(input: []const u8) Value {
+pub fn parse(input: []const u8) Value {
var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
var top = State{ .alloc = gpa.allocator(), .input = input };
var s = ⊤
@@ -268,13 +268,12 @@ pub fn read(input: []const u8) Value {
.end_improper_list => endImproperList(s),
.finish => s.finish() orelse break,
};
- std.debug.print("next: {}\n", .{s.next});
}
if (s.eof() or s.isFinalNull()) {
return s.retval;
} else {
// Should never happen.
- err(s, "READER BUG: unconsumed input");
+ err(s, "PARSER BUG: unconsumed input");
}
}
@@ -654,5 +653,5 @@ fn startBareString(s: *State) *State {
fn err(s: *State, msg: []const u8) noreturn {
std.debug.print("{s}\n", .{msg});
std.debug.print("pos: {}\n", .{s.pos});
- @panic("reader error");
+ @panic("parse error");
}