From a623d9b2ca83161f63eaafaf0f3c9e548ca7784f Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 1 Apr 2020 16:10:47 -0300 Subject: [PATCH] minor fixes on main file --- src/main.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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();