diff --git a/src/main.zig b/src/main.zig index 1dc803a..297ee9c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -19,11 +19,10 @@ pub fn run(allocator: *std.mem.Allocator, slice: []const u8) !Result { // do a full scan pass, then reset, then do it again (with parser) while (true) { var tok_opt = scan.nextToken() catch |err| { - std.debug.warn( - "error at '{}': {}\n", + std.debug.warn("error at '{}': {}\n", .{ scan.currentLexeme(), err, - ); + }); return Result.TokenizeError; }; @@ -76,7 +75,7 @@ pub fn main() anyerror!void { const filepath = try (args_it.next(allocator) orelse @panic("expected file path")); - var file = try std.fs.File.openRead(filepath); + var file = try std.fs.cwd().openFile(filepath, .{}); defer file.close(); const total_bytes = try file.getEndPos();