more fixes

This commit is contained in:
Luna 2020-07-23 17:17:06 -03:00
parent b0ddffd5fe
commit 5713df2a8b
3 changed files with 6 additions and 6 deletions

View file

@ -345,7 +345,7 @@ fn prettyType(typ: SymbolUnderlyingType) []const u8 {
pub fn printScope(scope: *Scope, ident: usize) void { pub fn printScope(scope: *Scope, ident: usize) void {
print(ident, "scope '{}' at addr {}\n", .{ scope.id, @ptrToInt(scope) }); print(ident, "scope '{}' at addr {}\n", .{ scope.id, @ptrToInt(scope) });
while (scope.env.items()) |entry| { for (scope.env.items()) |entry| {
print(ident + 1, "sym: {}, typ: {}\n", .{ entry.key, prettyType(entry.value) }); print(ident + 1, "sym: {}, typ: {}\n", .{ entry.key, prettyType(entry.value) });
} }
@ -366,10 +366,10 @@ pub fn printContext(ctx: CompilationContext) void {
}); });
for (fn_sym.decl.params.items) |param| { for (fn_sym.decl.params.items) |param| {
var param_kv = fn_sym.parameters.get(param.name.lexeme).?; var actual_param = fn_sym.parameters.get(param.name.lexeme).?;
std.debug.warn("\tparameter {} typ {}\n", .{ std.debug.warn("\tparameter {} typ {}\n", .{
param_kv.key, param.name.lexeme,
prettyType(param_kv.value.typ), prettyType(actual_param.typ),
}); });
} }

View file

@ -65,7 +65,7 @@ pub const Codegen = struct {
} }
fn emitForVariableType(self: *@This(), vari: anytype, get: anytype, kv: anytype) !llvm.LLVMValueRef { fn emitForVariableType(self: *@This(), vari: anytype, get: anytype, kv: anytype) !llvm.LLVMValueRef {
var sym = kv.value; var sym = kv;
switch (sym.*) { switch (sym.*) {
.Enum => |map| { .Enum => |map| {

View file

@ -215,7 +215,7 @@ pub const Parser = struct {
} }
/// check() against multiple tokens /// check() against multiple tokens
fn compareAnyOf(self: *@This(), ttypes: []TokenType) bool { fn compareAnyOf(self: *@This(), ttypes: []const TokenType) bool {
for (ttypes) |typ| { for (ttypes) |typ| {
if (self.check(typ)) return true; if (self.check(typ)) return true;
} }