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 {
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) });
}
@ -366,10 +366,10 @@ pub fn printContext(ctx: CompilationContext) void {
});
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", .{
param_kv.key,
prettyType(param_kv.value.typ),
param.name.lexeme,
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 {
var sym = kv.value;
var sym = kv;
switch (sym.*) {
.Enum => |map| {

View File

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