diff options
author | David Robillard <d@drobilla.net> | 2009-06-27 00:09:30 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-06-27 00:09:30 +0000 |
commit | 9ba1ca23fb217c747117c5bbff3fcaac98f5f261 (patch) | |
tree | 6109fd74688af3c35fc6007bbcb19fde7bbb1c51 /write.cpp | |
parent | 91d2737207d328647e1eb6c66ffca2dcc9277a46 (diff) | |
download | resp-9ba1ca23fb217c747117c5bbff3fcaac98f5f261.tar.gz resp-9ba1ca23fb217c747117c5bbff3fcaac98f5f261.tar.bz2 resp-9ba1ca23fb217c747117c5bbff3fcaac98f5f261.zip |
More CPS conversion work.
git-svn-id: http://svn.drobilla.net/resp/tuplr@151 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'write.cpp')
-rw-r--r-- | write.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -65,24 +65,24 @@ pprint_internal(ostream& out, const AST* ast, unsigned indent) ASymbol* headSym = tup->at(0)->to<ASymbol*>(); out << "("; pprint_internal(out, tup->at(0), indent); + unsigned child_indent = indent; if (tup->size() > 1) { out << " "; - if (headSym && headSym->cppstr == "fn") - out << tup->at(1) << " "; - else - pprint_internal(out, tup->at(1), indent + head.length() + 1); + if (headSym && headSym->cppstr == "fn") { + out << tup->at(1); + child_indent = indent + 4; + } else { + child_indent += head.length() + 1; + pprint_internal(out, tup->at(1), child_indent); + } } for (size_t i = 2; i < tup->size(); ++i) { - //if (!headSym || headSym->cppstr != "def") - out << endl; - //else - // out << " "; - out << string().insert(0, indent, ' '); - pprint_internal(out, tup->at(i), indent + head.length() + 2); + out << endl << string().insert(0, child_indent, ' '); + pprint_internal(out, tup->at(i), child_indent); } out << ")"; if (headSym && headSym->cppstr == "fn") - out << endl << string().insert(0, indent, ' '); + out << endl << string().insert(0, indent + 4, ' '); } else { out << ast; } |