diff options
author | Julien Dessaux | 2022-06-12 21:47:52 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-06-12 21:47:52 +0200 |
commit | f7a5e4f52c529a74ca0e4ec5a269c4d594990802 (patch) | |
tree | e15a2d8c22aae7efba67904048a121aa1e8cc7e3 /src/main.zig | |
parent | Implemented basic cli (diff) | |
download | zigfunge98-f7a5e4f52c529a74ca0e4ec5a269c4d594990802.tar.gz zigfunge98-f7a5e4f52c529a74ca0e4ec5a269c4d594990802.tar.bz2 zigfunge98-f7a5e4f52c529a74ca0e4ec5a269c4d594990802.zip |
Refactored io functions handling
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index 3bdf68d..6962c37 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,6 +1,7 @@ const std = @import("std"); const field = @import("field.zig"); const interpreter = @import("interpreter.zig"); +const io = @import("io.zig"); const pointer = @import("pointer.zig"); const stackStack = @import("stackStack.zig"); @@ -17,7 +18,7 @@ pub fn main() anyerror!void { var file = try std.fs.cwd().openFile("mycology/sanity.bf", .{}); defer file.close(); - var i = try interpreter.Interpreter.init(gpa.allocator(), file.reader(), null, args); + var i = try interpreter.Interpreter.init(gpa.allocator(), file.reader(), io.defaultFunctions, args); defer i.deinit(); std.os.exit(@intCast(u8, try i.run())); @@ -30,7 +31,7 @@ test "sanity" { var file = try std.fs.cwd().openFile("mycology/sanity.bf", .{}); defer file.close(); const args = [_][]const u8{"sanity"}; - var i = try interpreter.Interpreter.init(std.testing.allocator, file.reader(), null, args[0..]); + var i = try interpreter.Interpreter.init(std.testing.allocator, file.reader(), io.defaultFunctions, args[0..]); defer i.deinit(); try std.testing.expectEqual(try i.run(), 0); } |