diff options
author | David Robillard <d@drobilla.net> | 2010-12-31 22:32:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-31 22:32:13 +0000 |
commit | 84ef67971db229fffdfa4305d1f258fd87a5054b (patch) | |
tree | 48975c9562730ab5785d725699e6c44cfd684d2c /src | |
parent | 8f16aaca2a75c93bb9110724e1af96eeb48c59a6 (diff) | |
download | resp-84ef67971db229fffdfa4305d1f258fd87a5054b.tar.gz resp-84ef67971db229fffdfa4305d1f258fd87a5054b.tar.bz2 resp-84ef67971db229fffdfa4305d1f258fd87a5054b.zip |
Fix -P (don't look at types in printer unless annotations are requested).
git-svn-id: http://svn.drobilla.net/resp/resp@400 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src')
-rw-r--r-- | src/pprint.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pprint.cpp b/src/pprint.cpp index e83c089..be0a840 100644 --- a/src/pprint.cpp +++ b/src/pprint.cpp @@ -146,9 +146,13 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types) out << "(" << (*i++) << " "; const ATuple* const fn = tup->frrst()->as_tuple(); const ATuple* const prot = fn->frst()->as_tuple(); - const ATuple* const fnT = cenv->type(fn)->as_tuple(); - print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, fnT->prot()); - print_annotation(out, fn->list_last(), indent + head_width + 1, cenv, types); + if (types) { + const ATuple* const fnT = cenv->type(fn)->as_tuple(); + print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, fnT->prot()); + print_annotation(out, fn->list_last(), indent + head_width + 1, cenv, types); + } else { + print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, NULL); + } newline(out, indent + 2); print_list(out, fn, fn->iter_at(2), indent + 2, cenv, types, false); |