aboutsummaryrefslogtreecommitdiffstats
path: root/src/pprint.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-04-13 04:14:39 +0000
committerDavid Robillard <d@drobilla.net>2010-04-13 04:14:39 +0000
commitd15593d1cda3e7c56cccc4958d6e07f8f15c90f3 (patch)
treeb4cbe908ce34bf5e7c8c51fdb6af5d31a5dac87d /src/pprint.cpp
parent8675beae4f7a8415fc2e88451da95dc068719194 (diff)
downloadresp-d15593d1cda3e7c56cccc4958d6e07f8f15c90f3.tar.gz
resp-d15593d1cda3e7c56cccc4958d6e07f8f15c90f3.tar.bz2
resp-d15593d1cda3e7c56cccc4958d6e07f8f15c90f3.zip
Slightly less terrible "pretty" printing.
git-svn-id: http://svn.drobilla.net/resp/resp@255 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/pprint.cpp')
-rw-r--r--src/pprint.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pprint.cpp b/src/pprint.cpp
index 7dd36c5..5ee5736 100644
--- a/src/pprint.cpp
+++ b/src/pprint.cpp
@@ -82,11 +82,11 @@ pprint_internal(ostream& out, const AST* ast, unsigned indent)
unsigned child_indent = indent;
if (tup->size() > 1) {
out << " ";
- if (headSym && headSym->cppstr == "fn") {
+ if (headSym && (headSym->cppstr == "fn" || headSym->cppstr == "def")) {
out << *i;
- child_indent = indent + 4;
+ child_indent = indent + 2;
} else {
- child_indent += head.length() + 1;
+ child_indent += head.length() + 2;
pprint_internal(out, *i, child_indent);
}
}
@@ -95,8 +95,8 @@ pprint_internal(ostream& out, const AST* ast, unsigned indent)
pprint_internal(out, *i, child_indent);
}
out << ")";
- if (headSym && headSym->cppstr == "fn")
- out << endl << string().insert(0, indent + 4, ' ');
+ if (headSym && (headSym->cppstr == "fn" || headSym->cppstr == "def"))
+ out << endl << string().insert(0, indent + 2, ' ');
} else {
out << ast;
}