ast_printer: print return types

This commit is contained in:
Luna 2019-08-26 21:12:41 -03:00
parent 20e5c2339f
commit 1572b913f8

View file

@ -41,19 +41,19 @@ pub fn printNode(node: *Node, ident: usize) void {
printIdent(ident);
// TODO print return types
const ret_type = decl.return_type.lexeme;
if (decl.method) |method| {
const vari = method.variable.lexeme;
const typ = method.typ.lexeme;
if (method.mutable) {
warn("(method mut {} {} {} ", vari, typ, name);
warn("(method mut {} {} {} {} ", vari, typ, name, ret_type);
} else {
warn("(method {} {} {} ", vari, typ, name);
warn("(method {} {} {} {} ", vari, typ, name, ret_type);
}
} else {
warn("(fn {} (", name);
warn("(fn {} {} (", name, ret_type);
}
for (decl.params.toSlice()) |param| {