aboutsummaryrefslogtreecommitdiff
path: root/src/interpreter.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-12-04 04:06:47 +0100
committerJulien Dessaux2022-12-04 04:06:47 +0100
commitb373cbffa11f5f1f86f15f0be29b21993b42a5d7 (patch)
treebab595392417cab23148ba46994d3607ca54cebc /src/interpreter.zig
parentBegan writing a debugging tui (diff)
downloadzigfunge98-b373cbffa11f5f1f86f15f0be29b21993b42a5d7.tar.gz
zigfunge98-b373cbffa11f5f1f86f15f0be29b21993b42a5d7.tar.bz2
zigfunge98-b373cbffa11f5f1f86f15f0be29b21993b42a5d7.zip
Improved tui debugger
Diffstat (limited to 'src/interpreter.zig')
-rw-r--r--src/interpreter.zig14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/interpreter.zig b/src/interpreter.zig
index 51a542e..37ebba9 100644
--- a/src/interpreter.zig
+++ b/src/interpreter.zig
@@ -13,12 +13,6 @@ pub const Interpreter = struct {
self.field.deinit();
self.allocator.destroy(self);
}
- pub inline fn getField(self: *Interpreter) *field.Field {
- return self.field;
- }
- pub inline fn getPointer(self: *Interpreter) *pointer.Pointer {
- return self.pointer;
- }
pub fn init(allocator: std.mem.Allocator, fileReader: anytype, timestamp: ?i64, args: []const []const u8, env: []const [*:0]const u8) !*Interpreter {
var i = try allocator.create(Interpreter);
errdefer allocator.destroy(i);
@@ -31,12 +25,8 @@ pub const Interpreter = struct {
}
pub fn run(self: *Interpreter, ioContext: anytype) !i64 {
while (true) {
- if (try self.pointer.exec(ioContext)) |ret| {
- if (ret.code) |code| {
- return code;
- } else {
- return 0;
- }
+ if (try self.step(ioContext)) |ret| {
+ return ret;
}
}
}