From 1b0e41b22e4d658d056be427fa7108cacf3028cc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Oct 2009 15:08:28 +0000 Subject: Environment pretty/debug printing. git-svn-id: http://svn.drobilla.net/resp/tuplr@240 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/tuplr.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tuplr.hpp') 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 > > { } }; +template +ostream& operator<<(ostream& out, const Env& env) { + out << "(Env" << endl; + for (typename Env::const_reverse_iterator f = env.rbegin(); f != env.rend(); ++f) { + out << " (" << endl; + for (typename Env::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) * -- cgit v1.2.1