X-Git-Url: https://git.ayoreis.com/zlox.git/blobdiff_plain/9c8936ce5c881892e4e2f0cd0e7933014f3e3c41..f1f777199093f609b87f8e334589e9f0283249da:/src/main.zig?ds=inline diff --git a/src/main.zig b/src/main.zig index 19aae30..38bbddc 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,9 +1,10 @@ const std = @import("std"); const Allocator = std.mem.Allocator; +const Interpreter = @import("Interpreter.zig"); +const Stmt = @import("stmt.zig").Stmt; const Scanner = @import("Scanner.zig"); -const Token = @import("Token.zig"); const Parser = @import("Parser.zig"); -const Interpreter = @import("Interpreter.zig"); +const Token = @import("Token.zig"); const ErrorPayload = Interpreter.ErrorPayload; var interpreter: Interpreter = undefined; @@ -70,7 +71,7 @@ fn run(allocator: Allocator, source: []const u8) !void { defer allocator.free(tokens); var parser = try Parser.init(allocator, tokens); defer parser.deinit(); - const statements = try parser.parse(); + const statements: []const *const Stmt = @ptrCast(try parser.parse()); // Stop if there was a syntax error. if (hadError) return;