ast_printer: fix printing of func params
This commit is contained in:
parent
79107f876b
commit
d69365ba92
1 changed files with 5 additions and 4 deletions
|
@ -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| {
|
||||
|
|
Loading…
Reference in a new issue