diff options
author | Karl Berry <karl@freefriends.org> | 2009-08-15 23:57:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-08-15 23:57:48 +0000 |
commit | 16d128e5e10d541a78654b86409d5a3539f07708 (patch) | |
tree | 66de0af63c3811bb3040c16e9b52c11985f70811 /Build/source/utils/asymptote/item.h | |
parent | b20f78c549859ec0e8610bdd3ad904245e86b489 (diff) |
asymptote 1.83
git-svn-id: svn://tug.org/texlive/trunk@14696 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/item.h')
-rw-r--r-- | Build/source/utils/asymptote/item.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/Build/source/utils/asymptote/item.h b/Build/source/utils/asymptote/item.h index 9df090cc948..14caea884b0 100644 --- a/Build/source/utils/asymptote/item.h +++ b/Build/source/utils/asymptote/item.h @@ -11,7 +11,6 @@ #include "common.h" #include <typeinfo> - namespace vm { class item; @@ -22,7 +21,7 @@ T get(const item&); class item : public gc { public: - bool empty() + bool empty() const { return *kind == typeid(void); } item() @@ -113,12 +112,23 @@ private: }; class frame : public gc { +#ifdef DEBUG_FRAME + string name; +#endif typedef mem::vector<item> vars_t; vars_t vars; public: +#ifdef DEBUG_FRAME + frame(string name, size_t size) + : name(name), vars(size) + {} + + string getName() { return name; } +#else frame(size_t size) : vars(size) {} +#endif item& operator[] (size_t n) { return vars[n]; } @@ -181,18 +191,7 @@ inline bool isdefault(const item& it) return *it.kind == typeid(default_t); } -inline ostream& operator<< (ostream& out, const item& i) -{ - out << "type " << i.type().name(); - if (i.type() == typeid(Int)) - cout << ", value = " << get<Int>(i) << endl; - else if (i.type() == typeid(double)) - cout << ", value = " << get<double>(i) << endl; - else if (i.type() == typeid(string)) - cout << ", value = " << get<string>(i) << endl; - else out << endl; - return out; -} +ostream& operator<< (ostream& out, const item& i); } // namespace vm |