diff options
author | David Robillard <d@drobilla.net> | 2009-10-16 15:08:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-16 15:08:28 +0000 |
commit | 1b0e41b22e4d658d056be427fa7108cacf3028cc (patch) | |
tree | 7ab572d343fd2483edd5e67bc73b333ebb4b511c | |
parent | 338da7070dfe47fdf041b35a6d84c00fab6d9678 (diff) | |
download | resp-1b0e41b22e4d658d056be427fa7108cacf3028cc.tar.gz resp-1b0e41b22e4d658d056be427fa7108cacf3028cc.tar.bz2 resp-1b0e41b22e4d658d056be427fa7108cacf3028cc.zip |
Environment pretty/debug printing.
git-svn-id: http://svn.drobilla.net/resp/tuplr@240 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | src/tuplr.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 059a6cf..0385533 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -93,6 +93,19 @@ struct Env : public list< vector< pair<K,V> > > { } }; +template<typename K, typename V> +ostream& operator<<(ostream& out, const Env<K,V>& env) { + out << "(Env" << endl; + for (typename Env<K,V>::const_reverse_iterator f = env.rbegin(); f != env.rend(); ++f) { + out << " (" << endl; + for (typename Env<K,V>::Frame::const_iterator b = f->begin(); b != f->end(); ++b) + cout << " " << b->first << " " << b->second << endl; + out << " )" << endl; + } + out << ")" << endl; + return out; +} + /*************************************************************************** * Lexer: Text (istream) -> S-Expressions (SExp) * |