diff options
author | David Robillard <d@drobilla.net> | 2010-12-29 18:22:52 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-29 18:22:52 +0000 |
commit | 0076c050fb12c92a35b673d63fca82d5cff63bdb (patch) | |
tree | 3edb91c4b46b9d54a1bf592d0c7f4b5f3133d38f | |
parent | 16e20e1ddf652d45bf041d557bdc3becbbc5d99d (diff) | |
download | resp-0076c050fb12c92a35b673d63fca82d5cff63bdb.tar.gz resp-0076c050fb12c92a35b673d63fca82d5cff63bdb.tar.bz2 resp-0076c050fb12c92a35b673d63fca82d5cff63bdb.zip |
Always print first argument on next line if callee is a list.
git-svn-id: http://svn.drobilla.net/resp/resp@373 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | src/pprint.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/pprint.cpp b/src/pprint.cpp index 7b0ec3c..48debb1 100644 --- a/src/pprint.cpp +++ b/src/pprint.cpp @@ -117,17 +117,22 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types) if (i == tup->end()) return out << ")"; - std::string form = ""; - const ASymbol* sym = (*i)->to_symbol(); - unsigned head_width = 1; + std::string form = ""; + const ASymbol* sym = (*i)->to_symbol(); + unsigned head_width = 1; + bool head_is_list = (*i)->to_tuple(); if (sym) { form = sym->sym(); head_width = form.length() + 2; } print_to(out, *i++, indent + 1, cenv, types); - if (i != tup->end()) - out << " "; + if (i != tup->end()) { + if (head_is_list) + newline(out, indent + 1); + else + out << " "; + } if (form == "def") { out << (*i++); // Print symbol |