aboutsummaryrefslogtreecommitdiffstats
path: root/write.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-27 00:09:30 +0000
committerDavid Robillard <d@drobilla.net>2009-06-27 00:09:30 +0000
commit9ba1ca23fb217c747117c5bbff3fcaac98f5f261 (patch)
tree6109fd74688af3c35fc6007bbcb19fde7bbb1c51 /write.cpp
parent91d2737207d328647e1eb6c66ffca2dcc9277a46 (diff)
downloadresp-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.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/write.cpp b/write.cpp
index ba000f3..04e3401 100644
--- a/write.cpp
+++ b/write.cpp
@@ -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;
}