diff options
author | Julien Dessaux | 2022-08-13 01:23:32 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-08-13 01:23:32 +0200 |
commit | 0f440dfb6fc21c460b6c621571921298d94eb1b0 (patch) | |
tree | 4a7011ce12f4bf611883ea9b645e59a213d301af /src/interpreter.zig | |
parent | Implemented the under funge command (diff) | |
download | zigfunge98-0f440dfb6fc21c460b6c621571921298d94eb1b0.tar.gz zigfunge98-0f440dfb6fc21c460b6c621571921298d94eb1b0.tar.bz2 zigfunge98-0f440dfb6fc21c460b6c621571921298d94eb1b0.zip |
Add environment handling
Diffstat (limited to 'src/interpreter.zig')
-rw-r--r-- | src/interpreter.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interpreter.zig b/src/interpreter.zig index 05c4516..c378c11 100644 --- a/src/interpreter.zig +++ b/src/interpreter.zig @@ -13,13 +13,13 @@ pub const Interpreter = struct { self.field.deinit(); self.allocator.destroy(self); } - pub fn init(allocator: std.mem.Allocator, fileReader: anytype, args: []const []const u8) !*Interpreter { + pub fn init(allocator: std.mem.Allocator, fileReader: anytype, args: []const []const u8, env: []const [*:0]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, fileReader); errdefer i.field.deinit(); - i.pointer = try pointer.Pointer.init(std.testing.allocator, i.field, args); + i.pointer = try pointer.Pointer.init(std.testing.allocator, i.field, args, env); errdefer i.pointer.deinit(); return i; } |