diff options
Diffstat (limited to 'src/pprint.cpp')
-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 |