diff --git a/examples/hello.v b/examples/hello.v index 652d5a0..2352b8e 100644 --- a/examples/hello.v +++ b/examples/hello.v @@ -17,6 +17,8 @@ fn main(a int) int { mut a := 1+2 a = 2 + a = 1 && 0 + if a { println(30) } else { diff --git a/src/main.zig b/src/main.zig index bc07abc..47e3a53 100644 --- a/src/main.zig +++ b/src/main.zig @@ -13,7 +13,7 @@ pub const Result = error{ pub const StdOut = *std.io.OutStream(std.fs.File.WriteError); fn run(allocator: *Allocator, data: []u8) !void { - var stdout_file = try std.io.getStdOut(); + var stdout_file = std.io.getStdOut(); const stdout = &stdout_file.outStream().stream; var runner = runners.Runner.init(allocator, stdout); @@ -39,7 +39,7 @@ fn runFile(allocator: *Allocator, path: []const u8) !void { } fn runPrompt(allocator: *Allocator) !void { - var stdout_file = try std.io.getStdOut(); + var stdout_file = std.io.getStdOut(); const stdout = &stdout_file.outStream().stream; while (true) { @@ -71,7 +71,7 @@ pub fn main() anyerror!void { defer arena.deinit(); var allocator = &arena.allocator; - var stdout_file = try std.io.getStdOut(); + var stdout_file = std.io.getStdOut(); var stdout = &stdout_file.outStream().stream; var args_it = std.process.args(); diff --git a/src/parser.zig b/src/parser.zig index afe1ad6..46976e2 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -1029,8 +1029,8 @@ pub const Parser = struct { fn finishStructVal(self: *@This(), expr: *Expr) !*Expr { // {a: 10 b: 10} // for this to work properly, must be Variable, since its a type. - if (ast.ExprType(expr.*) != .Variable) { - self.doError("Expected variable for struct type, got {}", ast.ExprType(expr.*)); + if (@as(ast.ExprType, expr.*) != .Variable) { + self.doError("Expected variable for struct type, got {}", @as(ast.ExprType, expr.*)); return Result.CompileError; }