Этот коммит содержится в:
Luna 2019-12-07 19:45:12 -03:00
родитель 79b2d37ac0
Коммит f9e8543b7c
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -17,6 +17,8 @@ fn main(a int) int {
mut a := 1+2
a = 2
a = 1 && 0
if a {
println(30)
} else {

Просмотреть файл

@ -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();

Просмотреть файл

@ -1029,8 +1029,8 @@ pub const Parser = struct {
fn finishStructVal(self: *@This(), expr: *Expr) !*Expr {
// <expr>{a: 10 b: 10}
// for this to work properly, <expr> 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;
}