diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index af2a148..8417e8e 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -308,12 +308,6 @@ namespace chaiscript static void throw_exception(const Boxed_Value &bv) { throw bv; } - - static boost::shared_ptr bootstrap2(boost::shared_ptr e = boost::shared_ptr (new chaiscript::detail::Dispatch_Engine())) - { - e->add(user_type(), "void"); - return e; - } static std::string what(const std::exception &e) { diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index 29c6c8d..4ad7ffa 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -307,7 +307,7 @@ namespace chaiscript } template - std::string to_string_aux(const Boxed_Value &v) const + static std::string to_string_aux(const Boxed_Value &v) { std::ostringstream oss; oss << *static_cast(v.get_const_ptr()); @@ -520,7 +520,7 @@ namespace chaiscript return oper(Operators::assign_bitwise_and, this->bv, t_rhs.bv); } - void validate_boxed_number(const Boxed_Value &v) + static void validate_boxed_number(const Boxed_Value &v) { const Type_Info &inp_ = v.get_type_info(); if (inp_ == typeid(bool)) diff --git a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp index a43ce77..84c1bc7 100644 --- a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp +++ b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp @@ -50,11 +50,11 @@ namespace chaiscript virtual Boxed_Value convert(const Boxed_Value &derived) const = 0; virtual Boxed_Value convert_down(const Boxed_Value &base) const = 0; - const Type_Info &base() + const Type_Info &base() const { return m_base; } - const Type_Info &derived() + const Type_Info &derived() const { return m_derived; } diff --git a/include/chaiscript/dispatchkit/dynamic_object.hpp b/include/chaiscript/dispatchkit/dynamic_object.hpp index 8952a4a..440b085 100644 --- a/include/chaiscript/dispatchkit/dynamic_object.hpp +++ b/include/chaiscript/dispatchkit/dynamic_object.hpp @@ -31,7 +31,7 @@ namespace chaiscript return m_attrs[t_attr_name]; } - std::map get_attrs() + std::map get_attrs() const { return m_attrs; } diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp index 2b4aff7..551825b 100644 --- a/include/chaiscript/dispatchkit/proxy_functions.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions.hpp @@ -23,7 +23,7 @@ namespace chaiscript class Boxed_Number; struct AST_Node; - typedef boost::shared_ptr AST_NodePtr; + typedef boost::shared_ptr AST_NodePtr; namespace dispatch { diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index 2f7e0c1..fea4668 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -54,7 +54,7 @@ namespace chaiscript }; /// \brief Typedef for pointers to AST_Node objects. Used in building of the AST_Node tree - typedef boost::shared_ptr AST_NodePtr; + typedef boost::shared_ptr AST_NodePtr; /// \brief Classes which may be thrown during error cases when ChaiScript is executing. @@ -435,7 +435,7 @@ namespace chaiscript return eval_internal(t_e); } catch (exception::eval_error &ee) { ee.call_stack.push_back(shared_from_this()); - throw ee; + throw; } } diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 0b74d7b..05e468c 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -681,7 +681,7 @@ namespace chaiscript if (t_handler) { t_handler->handle(bv, m_engine); } - throw bv; + throw; } } @@ -707,7 +707,7 @@ namespace chaiscript if (t_handler) { t_handler->handle(bv, m_engine); } - throw bv; + throw; } } @@ -737,7 +737,7 @@ namespace chaiscript if (t_handler) { t_handler->handle(bv, m_engine); } - throw bv; + throw; } } @@ -753,7 +753,7 @@ namespace chaiscript if (t_handler) { t_handler->handle(bv, m_engine); } - throw bv; + throw; } } @@ -773,7 +773,7 @@ namespace chaiscript if (t_handler) { t_handler->handle(bv, m_engine); } - throw bv; + throw; } } }; diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index 888c982..4111bea 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -56,7 +56,8 @@ namespace chaiscript public: ChaiScript_Parser() - : m_multiline_comment_begin("/*"), + : m_line(-1), m_col(-1), + m_multiline_comment_begin("/*"), m_multiline_comment_end("*/"), m_singleline_comment("//") { @@ -804,10 +805,9 @@ namespace chaiscript */ bool Quoted_String_() { bool retval = false; - char prev_char = 0; if (has_more_input() && (*m_input_pos == '\"')) { retval = true; - prev_char = *m_input_pos; + char prev_char = *m_input_pos; ++m_input_pos; ++m_col; @@ -981,10 +981,9 @@ namespace chaiscript */ bool Single_Quoted_String_() { bool retval = false; - char prev_char = 0; if (has_more_input() && (*m_input_pos == '\'')) { retval = true; - prev_char = *m_input_pos; + char prev_char = *m_input_pos; ++m_input_pos; ++m_col; @@ -1350,7 +1349,6 @@ namespace chaiscript bool Def() { bool retval = false; bool is_annotated = false; - bool is_method = false; AST_NodePtr annotation; if (Annotation()) { @@ -1369,6 +1367,8 @@ namespace chaiscript throw exception::eval_error("Missing function name in definition", File_Position(m_line, m_col), *m_filename); } + bool is_method = false; + if (Symbol("::", false)) { //We're now a method is_method = true;