fixes for latest zig
This commit is contained in:
parent
79b2d37ac0
commit
f9e8543b7c
3 changed files with 7 additions and 5 deletions
|
@ -17,6 +17,8 @@ fn main(a int) int {
|
||||||
mut a := 1+2
|
mut a := 1+2
|
||||||
a = 2
|
a = 2
|
||||||
|
|
||||||
|
a = 1 && 0
|
||||||
|
|
||||||
if a {
|
if a {
|
||||||
println(30)
|
println(30)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub const Result = error{
|
||||||
pub const StdOut = *std.io.OutStream(std.fs.File.WriteError);
|
pub const StdOut = *std.io.OutStream(std.fs.File.WriteError);
|
||||||
|
|
||||||
fn run(allocator: *Allocator, data: []u8) !void {
|
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;
|
const stdout = &stdout_file.outStream().stream;
|
||||||
|
|
||||||
var runner = runners.Runner.init(allocator, stdout);
|
var runner = runners.Runner.init(allocator, stdout);
|
||||||
|
@ -39,7 +39,7 @@ fn runFile(allocator: *Allocator, path: []const u8) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn runPrompt(allocator: *Allocator) !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;
|
const stdout = &stdout_file.outStream().stream;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -71,7 +71,7 @@ pub fn main() anyerror!void {
|
||||||
defer arena.deinit();
|
defer arena.deinit();
|
||||||
var allocator = &arena.allocator;
|
var allocator = &arena.allocator;
|
||||||
|
|
||||||
var stdout_file = try std.io.getStdOut();
|
var stdout_file = std.io.getStdOut();
|
||||||
var stdout = &stdout_file.outStream().stream;
|
var stdout = &stdout_file.outStream().stream;
|
||||||
|
|
||||||
var args_it = std.process.args();
|
var args_it = std.process.args();
|
||||||
|
|
|
@ -1029,8 +1029,8 @@ pub const Parser = struct {
|
||||||
fn finishStructVal(self: *@This(), expr: *Expr) !*Expr {
|
fn finishStructVal(self: *@This(), expr: *Expr) !*Expr {
|
||||||
// <expr>{a: 10 b: 10}
|
// <expr>{a: 10 b: 10}
|
||||||
// for this to work properly, <expr> must be Variable, since its a type.
|
// for this to work properly, <expr> must be Variable, since its a type.
|
||||||
if (ast.ExprType(expr.*) != .Variable) {
|
if (@as(ast.ExprType, expr.*) != .Variable) {
|
||||||
self.doError("Expected variable for struct type, got {}", ast.ExprType(expr.*));
|
self.doError("Expected variable for struct type, got {}", @as(ast.ExprType, expr.*));
|
||||||
return Result.CompileError;
|
return Result.CompileError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue