Fixed bugs reported by the mycology test suite
This commit is contained in:
parent
e42624f105
commit
357c54663c
3 changed files with 4 additions and 5 deletions
|
@ -287,7 +287,7 @@ pub const Field = struct {
|
|||
}
|
||||
}
|
||||
switch (buffer[i]) {
|
||||
12 => x += 1,
|
||||
12 => continue,
|
||||
'\r' => {
|
||||
x = 0;
|
||||
y += 1;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue