diff options
Diffstat (limited to 'src/interpreter.zig')
-rw-r--r-- | src/interpreter.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interpreter.zig b/src/interpreter.zig index a947d6f..05c4516 100644 --- a/src/interpreter.zig +++ b/src/interpreter.zig @@ -13,19 +13,19 @@ pub const Interpreter = struct { self.field.deinit(); self.allocator.destroy(self); } - pub fn init(allocator: std.mem.Allocator, reader: anytype, ioFunctions: io.Functions, args: []const []const u8) !*Interpreter { + pub fn init(allocator: std.mem.Allocator, fileReader: anytype, args: []const []const u8) !*Interpreter { var i = try allocator.create(Interpreter); errdefer allocator.destroy(i); i.allocator = allocator; - i.field = try field.Field.init_from_reader(allocator, reader); + i.field = try field.Field.init_from_reader(allocator, fileReader); errdefer i.field.deinit(); - i.pointer = try pointer.Pointer.init(std.testing.allocator, i.field, ioFunctions, args); + i.pointer = try pointer.Pointer.init(std.testing.allocator, i.field, args); errdefer i.pointer.deinit(); return i; } - pub fn run(self: *Interpreter) !i64 { + pub fn run(self: *Interpreter, ioContext: anytype) !i64 { while (true) { - if (try self.pointer.exec()) |ret| { + if (try self.pointer.exec(ioContext)) |ret| { if (ret.code) |code| { return code; } else { |