diff options
author | David Robillard <d@drobilla.net> | 2010-12-08 16:38:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-08 16:38:38 +0000 |
commit | 583a2d9d2397ff174b16d7df377f16c1df6fe875 (patch) | |
tree | f1c2c8c1c4f0689996bf46a5cdb8a7a7098a4fe5 | |
parent | 77c17635fa81c1fe992d064cbdef435c48004485 (diff) | |
download | resp-583a2d9d2397ff174b16d7df377f16c1df6fe875.tar.gz resp-583a2d9d2397ff174b16d7df377f16c1df6fe875.tar.bz2 resp-583a2d9d2397ff174b16d7df377f16c1df6fe875.zip |
Print type annotations correctly.
Print newlines between definitions.
git-svn-id: http://svn.drobilla.net/resp/resp@312 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | src/pprint.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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); } |