diff --git a/src/ast_printer.zig b/src/ast_printer.zig index 4d45ad7..e818c00 100644 --- a/src/ast_printer.zig +++ b/src/ast_printer.zig @@ -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| {