Merge branch '2011-09-09-CxScript' of https://github.com/ChaiScript/ChaiScript into 2011-09-09-CxScript

This commit is contained in:
Jonathan Turner
2011-09-24 12:26:17 -06:00
80 changed files with 163 additions and 165 deletions

View File

@@ -72,10 +72,6 @@ namespace chaiscript
class Thread_Storage
{
public:
~Thread_Storage()
{
}
inline T *operator->() const
{
return get_tls().get();
@@ -92,7 +88,7 @@ namespace chaiscript
{
unique_lock<mutex> lock(m_mutex);
typename std::map<std::thread::id, std::shared_ptr<T> >::iterator itr = m_instances.find(std::this_thread::get_id());
auto itr = m_instances.find(std::this_thread::get_id());
if (itr != m_instances.end()) { return itr->second; }

View File

@@ -19,15 +19,15 @@ namespace chaiscript {
class bad_any_cast : public std::bad_cast
{
public:
bad_any_cast() throw()
bad_any_cast() noexcept
: m_what("bad any cast")
{
}
virtual ~bad_any_cast() throw() {}
virtual ~bad_any_cast() noexcept {}
/// \brief Description of what error occured
virtual const char * what() const throw()
virtual const char * what() const noexcept
{
return m_what.c_str();
}
@@ -79,7 +79,7 @@ namespace chaiscript {
public:
// construct/copy/destruct
Any() {}
Any() = default;
Any(const Any &t_any)
{

View File

@@ -22,25 +22,25 @@ namespace chaiscript
{
public:
bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to,
const std::string &t_what) throw()
const std::string &t_what) noexcept
: from(t_from), to(&t_to), m_what(t_what)
{
}
bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to) throw()
bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to) noexcept
: from(t_from), to(&t_to), m_what("Cannot perform boxed_cast")
{
}
bad_boxed_cast(const std::string &t_what) throw()
bad_boxed_cast(const std::string &t_what) noexcept
: m_what(t_what)
{
}
virtual ~bad_boxed_cast() throw() {}
virtual ~bad_boxed_cast() noexcept {}
/// \brief Description of what error occured
virtual const char * what() const throw()
virtual const char * what() const noexcept
{
return m_what.c_str();
}

View File

@@ -289,7 +289,7 @@ namespace chaiscript
static bool has_guard(const Const_Proxy_Function &t_pf)
{
std::shared_ptr<const dispatch::Dynamic_Proxy_Function> pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf);
auto pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf);
if (pf)
{
return bool(pf->get_guard());
@@ -300,7 +300,7 @@ namespace chaiscript
static Const_Proxy_Function get_guard(const Const_Proxy_Function &t_pf)
{
std::shared_ptr<const dispatch::Dynamic_Proxy_Function> pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf);
auto pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf);
if (pf)
{
if (pf->get_guard())
@@ -318,7 +318,9 @@ namespace chaiscript
throw bv;
}
static std::shared_ptr<chaiscript::detail::Dispatch_Engine> bootstrap2(std::shared_ptr<chaiscript::detail::Dispatch_Engine> e = std::shared_ptr<chaiscript::detail::Dispatch_Engine> (new chaiscript::detail::Dispatch_Engine()))
static std::shared_ptr<chaiscript::detail::Dispatch_Engine> bootstrap2(
std::shared_ptr<chaiscript::detail::Dispatch_Engine> e
= std::shared_ptr<chaiscript::detail::Dispatch_Engine> (new chaiscript::detail::Dispatch_Engine()))
{
e->add(user_type<void>(), "void");
return e;

View File

@@ -41,12 +41,12 @@ namespace chaiscript
class reserved_word_error : public std::runtime_error
{
public:
reserved_word_error(const std::string &t_word) throw()
reserved_word_error(const std::string &t_word) noexcept
: std::runtime_error("Reserved word not allowed in object name: " + t_word), m_word(t_word)
{
}
virtual ~reserved_word_error() throw() {}
virtual ~reserved_word_error() noexcept {}
std::string word() const
{
@@ -64,12 +64,12 @@ namespace chaiscript
class global_non_const : public std::runtime_error
{
public:
global_non_const() throw()
global_non_const() noexcept
: std::runtime_error("a global object must be const")
{
}
virtual ~global_non_const() throw() {}
virtual ~global_non_const() noexcept {}
};
}

View File

@@ -20,22 +20,22 @@ namespace chaiscript
{
public:
bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to,
const std::string &t_what) throw()
const std::string &t_what) noexcept
: bad_boxed_cast(t_from, t_to, t_what)
{
}
bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to) throw()
bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to) noexcept
: bad_boxed_cast(t_from, t_to)
{
}
bad_boxed_dynamic_cast(const std::string &w) throw()
bad_boxed_dynamic_cast(const std::string &w) noexcept
: bad_boxed_cast(w)
{
}
virtual ~bad_boxed_dynamic_cast() throw() {}
virtual ~bad_boxed_dynamic_cast() noexcept {}
};
}

View File

@@ -188,11 +188,11 @@ namespace chaiscript
class guard_error : public std::runtime_error
{
public:
guard_error() throw()
guard_error() noexcept
: std::runtime_error("Guard evaluation failed")
{ }
virtual ~guard_error() throw()
virtual ~guard_error() noexcept
{ }
};
}
@@ -587,17 +587,17 @@ namespace chaiscript
class dispatch_error : public std::runtime_error
{
public:
dispatch_error() throw()
dispatch_error() noexcept
: std::runtime_error("No matching function to dispatch to")
{
}
dispatch_error(bool is_const) throw()
dispatch_error(bool is_const) noexcept
: std::runtime_error(std::string("No matching function to dispatch to") + (is_const?", parameter is const":""))
{
}
virtual ~dispatch_error() throw() {}
virtual ~dispatch_error() noexcept {}
};
}

View File

@@ -32,7 +32,7 @@ namespace chaiscript
{
}
virtual ~arity_error() throw() {}
virtual ~arity_error() noexcept {}
int got;
int expected;

View File

@@ -70,17 +70,17 @@ namespace chaiscript
std::string filename;
std::vector<AST_NodePtr> call_stack;
eval_error(const std::string &t_why, const File_Position &t_where, const std::string &t_fname) throw() :
eval_error(const std::string &t_why, const File_Position &t_where, const std::string &t_fname) noexcept :
std::runtime_error(format(t_why, t_where, t_fname)),
reason(t_why), start_position(t_where), end_position(t_where), filename(t_fname)
{ }
eval_error(const std::string &t_why) throw()
eval_error(const std::string &t_why) noexcept
: std::runtime_error("Error: \"" + t_why + "\" "),
reason(t_why)
{}
virtual ~eval_error() throw() {}
virtual ~eval_error() noexcept {}
private:
static std::string format(const std::string &t_why, const File_Position &t_where, const std::string &t_fname)
@@ -98,11 +98,11 @@ namespace chaiscript
* Errors generated when loading a file
*/
struct file_not_found_error : public std::runtime_error {
file_not_found_error(const std::string &t_filename) throw()
file_not_found_error(const std::string &t_filename) noexcept
: std::runtime_error("File Not Found: " + t_filename)
{ }
virtual ~file_not_found_error() throw() {}
virtual ~file_not_found_error() noexcept {}
};
}

View File

@@ -35,12 +35,12 @@ namespace chaiscript
/// \brief Thrown if an error occurs while attempting to load a binary module
struct load_module_error : std::runtime_error
{
load_module_error(const std::string &t_reason) throw()
load_module_error(const std::string &t_reason) noexcept
: std::runtime_error(t_reason)
{
}
virtual ~load_module_error() throw()
virtual ~load_module_error() noexcept
{
}
};