From 583a2d9d2397ff174b16d7df377f16c1df6fe875 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Dec 2010 16:38:38 +0000 Subject: Print type annotations correctly. Print newlines between definitions. git-svn-id: http://svn.drobilla.net/resp/resp@312 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/pprint.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pprint.cpp b/src/pprint.cpp index 5253316..5d2cd5f 100644 --- a/src/pprint.cpp +++ b/src/pprint.cpp @@ -95,11 +95,13 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types) const AST* sym = *i++; out << sym; if (types) - out << " :" << cenv->tsubst.apply(cenv->tenv.var(sym)); + out << " :" << cenv->type(tup->list_ref(2)); // Print value on following lines, indented newline(out, indent + 2); - return print_tuple(out, tup, i, indent, true, cenv, types, false); + print_tuple(out, tup, i, indent, true, cenv, types, false); + newline(out, 0); + return out; } else if (form == "fn") { out << (*i++) << " "; @@ -133,7 +135,12 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types) } return out; - + + } else if (form == "def-type") { + print_tuple(out, tup, i, indent + 1, false, cenv, types, false); + newline(out, 0); + return out; + } else { return print_tuple(out, tup, i, indent + 1, false, cenv, types, false); } -- cgit v1.2.1