ast_printer: fix printing of func params
This commit is contained in:
parent
79107f876b
commit
d69365ba92
|
@ -48,20 +48,21 @@ pub fn printNode(node: *const Node, ident: usize) void {
|
||||||
const typ = method.typ.lexeme;
|
const typ = method.typ.lexeme;
|
||||||
|
|
||||||
if (method.mutable) {
|
if (method.mutable) {
|
||||||
warn("(method mut {} {} {} {} ", vari, typ, name, ret_type);
|
warn("(method mut {} {} {} {} (", vari, typ, name, ret_type);
|
||||||
} else {
|
} else {
|
||||||
warn("(method {} {} {} {} ", vari, typ, name, ret_type);
|
warn("(method {} {} {} {} (", vari, typ, name, ret_type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warn("(fn {} {} (", name, ret_type);
|
warn("(fn {} {} (", name, ret_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (decl.params.toSlice()) |param| {
|
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);
|
printBlock(ident + 1, decl.body, false);
|
||||||
warn(")\n");
|
warn("\n");
|
||||||
},
|
},
|
||||||
|
|
||||||
.ConstDecl => |consts| {
|
.ConstDecl => |consts| {
|
||||||
|
|
Loading…
Reference in New Issue