diff options
| author | Baitinq <[email protected]> | 2025-01-08 23:09:07 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-08 23:09:07 +0100 |
| commit | c8d47cfd23654c4f18953f3e675eff5a9d5ba791 (patch) | |
| tree | ae26978b3e2be9750df25d8bb3325367720f1413 /src | |
| parent | Parser: general cleanup (diff) | |
| download | interpreter-c8d47cfd23654c4f18953f3e675eff5a9d5ba791.tar.gz interpreter-c8d47cfd23654c4f18953f3e675eff5a9d5ba791.tar.bz2 interpreter-c8d47cfd23654c4f18953f3e675eff5a9d5ba791.zip | |
Misc: Dont crash REPL if parsing fails
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index e6de7f9..c8ebcfe 100644 --- a/src/main.zig +++ b/src/main.zig @@ -23,7 +23,9 @@ pub fn main() !void { const buf = try stdin.readUntilDelimiterAlloc(allocator, '\n', 1024); defer allocator.free(buf); - try process_buf(buf, allocator); + process_buf(buf, allocator) catch |err| { + try stdout.print("Error parsing line: {any}\n", .{err}); + }; } } else { std.debug.print("Tokenizing! {s}\n", .{path}); |