Merge branch 'master' into 2010-09-09-CxScript

Conflicts:
	include/chaiscript/dispatchkit/bad_boxed_cast.hpp
This commit is contained in:
Jason Turner 2012-06-01 08:50:15 -06:00
commit 8f7793a795
4 changed files with 17 additions and 12 deletions

View File

@ -33,7 +33,7 @@ namespace chaiscript
} }
bad_boxed_cast(const std::string &t_what) noexcept bad_boxed_cast(const std::string &t_what) noexcept
: m_what(t_what) : to(0), m_what(t_what)
{ {
} }

View File

@ -45,6 +45,7 @@ namespace chaiscript
{ {
public: public:
virtual Boxed_Value convert(const Boxed_Value &derived) = 0; virtual Boxed_Value convert(const Boxed_Value &derived) = 0;
const Type_Info &base() const Type_Info &base()
{ {
return m_base; return m_base;
@ -60,6 +61,8 @@ namespace chaiscript
{ {
} }
virtual ~Dynamic_Conversion() {}
private: private:
Type_Info m_base; Type_Info m_base;
Type_Info m_derived; Type_Info m_derived;

View File

@ -30,39 +30,40 @@ namespace chaiscript
public: public:
Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void, Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void,
bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bareti) bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bareti)
: m_is_const(t_is_const), m_is_reference(t_is_reference), m_is_pointer(t_is_pointer), : m_type_info(t_ti), m_bare_type_info(t_bareti),
m_is_const(t_is_const), m_is_reference(t_is_reference), m_is_pointer(t_is_pointer),
m_is_void(t_is_void), m_is_arithmetic(t_is_arithmetic), m_is_void(t_is_void), m_is_arithmetic(t_is_arithmetic),
m_type_info(t_ti), m_bare_type_info(t_bareti),
m_is_undef(false) m_is_undef(false)
{ {
} }
Type_Info() Type_Info()
: m_is_const(false), m_is_reference(false), m_is_pointer(false), : m_type_info(0), m_bare_type_info(0),
m_is_void(false), m_is_arithmetic(false), m_type_info(0), m_bare_type_info(0), m_is_const(false), m_is_reference(false), m_is_pointer(false),
m_is_void(false), m_is_arithmetic(false),
m_is_undef(true) m_is_undef(true)
{ {
} }
Type_Info(const Type_Info &ti) Type_Info(const Type_Info &ti)
: m_is_const(ti.m_is_const), m_is_reference(ti.m_is_reference), : m_type_info(ti.m_type_info),
m_bare_type_info(ti.m_bare_type_info),
m_is_const(ti.m_is_const), m_is_reference(ti.m_is_reference),
m_is_pointer(ti.m_is_pointer), m_is_pointer(ti.m_is_pointer),
m_is_void(ti.m_is_void), m_is_arithmetic(ti.m_is_arithmetic), m_is_void(ti.m_is_void), m_is_arithmetic(ti.m_is_arithmetic),
m_type_info(ti.m_type_info),
m_bare_type_info(ti.m_bare_type_info),
m_is_undef(ti.m_is_undef) m_is_undef(ti.m_is_undef)
{ {
} }
Type_Info &operator=(const Type_Info &ti) Type_Info &operator=(const Type_Info &ti)
{ {
m_type_info = ti.m_type_info;
m_bare_type_info = ti.m_bare_type_info;
m_is_const = ti.m_is_const; m_is_const = ti.m_is_const;
m_is_reference = ti.m_is_reference; m_is_reference = ti.m_is_reference;
m_is_pointer = ti.m_is_pointer; m_is_pointer = ti.m_is_pointer;
m_is_void = ti.m_is_void; m_is_void = ti.m_is_void;
m_is_arithmetic = ti.m_is_arithmetic; m_is_arithmetic = ti.m_is_arithmetic;
m_type_info = ti.m_type_info;
m_bare_type_info = ti.m_bare_type_info;
m_is_undef = ti.m_is_undef; m_is_undef = ti.m_is_undef;
return *this; return *this;
} }
@ -117,13 +118,13 @@ namespace chaiscript
} }
private: private:
const std::type_info *m_type_info;
const std::type_info *m_bare_type_info;
bool m_is_const; bool m_is_const;
bool m_is_reference; bool m_is_reference;
bool m_is_pointer; bool m_is_pointer;
bool m_is_void; bool m_is_void;
bool m_is_arithmetic; bool m_is_arithmetic;
const std::type_info *m_type_info;
const std::type_info *m_bare_type_info;
bool m_is_undef; bool m_is_undef;
}; };

View File

@ -230,6 +230,7 @@ int main(int argc, char *argv[])
case eInteractive : interactive(chai); break; case eInteractive : interactive(chai); break;
case eCommand : val = chai.eval(arg); break; case eCommand : val = chai.eval(arg); break;
case eFile : val = chai.eval_file(arg); break; case eFile : val = chai.eval_file(arg); break;
default : std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE;
} }
} }
catch (const chaiscript::exception::eval_error &ee) { catch (const chaiscript::exception::eval_error &ee) {