ast_printer: print return types
This commit is contained in:
parent
20e5c2339f
commit
1572b913f8
1 changed files with 4 additions and 4 deletions
|
@ -41,19 +41,19 @@ pub fn printNode(node: *Node, ident: usize) void {
|
||||||
|
|
||||||
printIdent(ident);
|
printIdent(ident);
|
||||||
|
|
||||||
// TODO print return types
|
const ret_type = decl.return_type.lexeme;
|
||||||
|
|
||||||
if (decl.method) |method| {
|
if (decl.method) |method| {
|
||||||
const vari = method.variable.lexeme;
|
const vari = method.variable.lexeme;
|
||||||
const typ = method.typ.lexeme;
|
const typ = method.typ.lexeme;
|
||||||
|
|
||||||
if (method.mutable) {
|
if (method.mutable) {
|
||||||
warn("(method mut {} {} {} ", vari, typ, name);
|
warn("(method mut {} {} {} {} ", vari, typ, name, ret_type);
|
||||||
} else {
|
} else {
|
||||||
warn("(method {} {} {} ", vari, typ, name);
|
warn("(method {} {} {} {} ", vari, typ, name, ret_type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warn("(fn {} (", name);
|
warn("(fn {} {} (", name, ret_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (decl.params.toSlice()) |param| {
|
for (decl.params.toSlice()) |param| {
|
||||||
|
|
Loading…
Reference in a new issue