zig fmt pass

This commit is contained in:
Luna 2020-07-23 16:42:49 -03:00
parent 3a55f8dbcc
commit 03561ebe6a
5 changed files with 11 additions and 11 deletions

View file

@ -25,7 +25,7 @@ pub const Analyzer = struct {
};
}
fn setErrContext(self: *@This(), comptime fmt: ?[]const u8, args: var) void {
fn setErrContext(self: *@This(), comptime fmt: ?[]const u8, args: anytype) void {
if (fmt == null) {
self.err_ctx = null;
return;
@ -42,7 +42,7 @@ pub const Analyzer = struct {
self.err_tok = tok;
}
fn doError(self: *@This(), comptime fmt: []const u8, args: var) void {
fn doError(self: *@This(), comptime fmt: []const u8, args: anytype) void {
self.hadError = true;
std.debug.warn("analysis error", .{});

View file

@ -14,12 +14,12 @@ fn printIdent(ident: usize) void {
}
}
fn print(ident: usize, comptime fmt: []const u8, args: var) void {
fn print(ident: usize, comptime fmt: []const u8, args: anytype) void {
printIdent(ident);
std.debug.warn(fmt, args);
}
fn printBlock(ident: usize, block: var, endNewline: bool) void {
fn printBlock(ident: usize, block: anytype, endNewline: bool) void {
std.debug.warn("(\n", .{});
for (block.toSlice()) |stmt| {
@ -156,7 +156,7 @@ fn binOpToStr(op: BinaryOperator) ?[]const u8 {
return null;
}
fn printBinOp(inner: var) void {
fn printBinOp(inner: anytype) void {
std.debug.warn("({}", .{binOpToStr(inner.op)});
printTwoExprs(inner.left, inner.right);
std.debug.warn(")", .{});

View file

@ -64,7 +64,7 @@ pub const Codegen = struct {
};
}
fn emitForVariableType(self: *@This(), vari: var, get: var, kv: var) !llvm.LLVMValueRef {
fn emitForVariableType(self: *@This(), vari: anytype, get: anytype, kv: anytype) !llvm.LLVMValueRef {
var sym = kv.value;
switch (sym.*) {
@ -89,7 +89,7 @@ pub const Codegen = struct {
fn emitExpr(
self: *Codegen,
builder: var,
builder: anytype,
expr: *const ast.Expr,
) anyerror!llvm.LLVMValueRef {
return switch (expr.*) {
@ -260,7 +260,7 @@ pub const Codegen = struct {
};
}
fn emitStmt(self: *Codegen, builder: var, stmt: *ast.Stmt) anyerror!void {
fn emitStmt(self: *Codegen, builder: anytype, stmt: *ast.Stmt) anyerror!void {
std.debug.warn("cgen: emitting stmt {}\n", .{@as(ast.StmtType, stmt.*)});
switch (stmt.*) {

View file

@ -12,7 +12,7 @@ pub fn reportN(line: usize, message: []const u8) void {
report(line, "", message);
}
pub fn reportFmt(line: usize, ctx_opt: ?[]const u8, comptime fmt: []const u8, args: var) void {
pub fn reportFmt(line: usize, ctx_opt: ?[]const u8, comptime fmt: []const u8, args: anytype) void {
if (ctx_opt) |ctx| {
std.debug.warn("[line {}] Error on {}", .{ line, ctx });
} else {

View file

@ -94,7 +94,7 @@ pub const Parser = struct {
self.tokens.deinit();
}
fn setErrContext(self: *Parser, comptime fmt: ?[]const u8, args: var) void {
fn setErrContext(self: *Parser, comptime fmt: ?[]const u8, args: anytype) void {
if (fmt == null) {
self.err_ctx = null;
return;
@ -104,7 +104,7 @@ pub const Parser = struct {
self.err_ctx = std.fmt.bufPrint(buf, fmt.?, args) catch unreachable;
}
fn doError(self: *Parser, comptime fmt: []const u8, args: var) ParseError {
fn doError(self: *Parser, comptime fmt: []const u8, args: anytype) ParseError {
self.hadError = true;
std.debug.warn("parser error at line {}", .{self.scanner.line});