ast_printer: fix printing of func params

This commit is contained in:
Luna 2019-09-20 13:36:15 -03:00
parent 79107f876b
commit d69365ba92
1 changed files with 5 additions and 4 deletions

View File

@ -48,20 +48,21 @@ pub fn printNode(node: *const Node, ident: usize) void {
const typ = method.typ.lexeme;
if (method.mutable) {
warn("(method mut {} {} {} {} ", vari, typ, name, ret_type);
warn("(method mut {} {} {} {} (", vari, typ, name, ret_type);
} else {
warn("(method {} {} {} {} ", vari, typ, name, ret_type);
warn("(method {} {} {} {} (", vari, typ, name, ret_type);
}
} else {
warn("(fn {} {} (", name, ret_type);
}
for (decl.params.toSlice()) |param| {
warn("({} {}) ", param.name.lexeme, param.typ.lexeme);
warn(" ({} {})", param.name.lexeme, param.typ.lexeme);
}
warn(") ");
printBlock(ident + 1, decl.body, false);
warn(")\n");
warn("\n");
},
.ConstDecl => |consts| {