1
0
Fork 0

Fixed bugs reported by the mycology test suite

This commit is contained in:
Julien Dessaux 2022-08-15 19:24:34 +02:00
parent e42624f105
commit 357c54663c
Signed by: adyxax
GPG key ID: F92E51B86E07177E
3 changed files with 4 additions and 5 deletions

View file

@ -287,7 +287,7 @@ pub const Field = struct {
}
}
switch (buffer[i]) {
12 => x += 1,
12 => continue,
'\r' => {
x = 0;
y += 1;

View file

@ -12,7 +12,7 @@ pub fn main() anyerror!void {
std.os.exit(1);
}
var file = try std.fs.cwd().openFile("mycology/sanity.bf", .{});
var file = try std.fs.cwd().openFile(args[1], .{});
defer file.close();
const env: []const [*:0]const u8 = std.os.environ;

View file

@ -12,9 +12,8 @@ pub const Stack = struct {
self.allocator.destroy(self);
}
pub fn duplicate(self: *Stack) !void {
if (self.data.items.len > 0) {
try self.push(self.data.items[self.data.items.len - 1]);
}
const v = self.pop();
try self.pushVector([2]i64{ v, v });
}
test "duplicate" {
var s = try Stack.init(std.testing.allocator);