aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tuplr.hpp')
-rw-r--r--tuplr.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index e7a2329..c86ff68 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -36,9 +36,6 @@ using boost::format;
* Basic Utility Classes *
***************************************************************************/
-extern std::ostream& err;
-extern std::ostream& out;
-
struct Cursor {
Cursor(const string& n="", unsigned l=1, unsigned c=0) : name(n), line(l), col(c) {}
operator bool() const { return !(line == 1 && col == 0); }
@@ -55,6 +52,12 @@ struct Error {
Cursor loc;
};
+struct Log {
+ Log(ostream& o, ostream& e) : out(o), err(e) {}
+ ostream& out;
+ ostream& err;
+};
+
template<typename Atom>
struct Exp {
Exp(Cursor c) : type(LIST), loc(c) {}
@@ -465,7 +468,7 @@ struct CEnvPimpl;
/// Compile-Time Environment
struct CEnv {
- CEnv(PEnv& p, TEnv& t, CEngine& engine);
+ CEnv(PEnv& p, TEnv& t, CEngine& e, ostream& os=std::cout, ostream& es=std::cerr);
~CEnv();
typedef Env<const ASTSymbol*, AST*> Code;
@@ -486,6 +489,7 @@ struct CEnv {
Vals vals;
unsigned symID;
CFunction alloc;
+ Log log;
private:
CEnvPimpl* _pimpl;