From afa96ecbf98379a9d2007ac7d11cd1e29a8ca307 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 10 Sep 2011 06:55:27 -0600 Subject: [PATCH] Begin port to C++11 --- CMakeLists.txt | 2 +- include/chaiscript/chaiscript.hpp | 12 +- include/chaiscript/dispatchkit/bootstrap.hpp | 18 +-- include/chaiscript/dispatchkit/boxed_cast.hpp | 10 +- .../dispatchkit/boxed_cast_helper.hpp | 42 +++---- .../chaiscript/dispatchkit/boxed_value.hpp | 38 +++--- .../chaiscript/dispatchkit/dispatchkit.hpp | 12 +- .../dispatchkit/dynamic_cast_conversion.hpp | 16 +-- .../dispatchkit/exception_specification.hpp | 2 +- .../dispatchkit/function_call_detail.hpp | 4 +- .../chaiscript/dispatchkit/handle_return.hpp | 12 +- .../dispatchkit/proxy_constructors.hpp | 6 +- .../dispatchkit/proxy_functions.hpp | 12 +- include/chaiscript/dispatchkit/type_info.hpp | 8 +- .../chaiscript/language/chaiscript_common.hpp | 8 +- .../chaiscript/language/chaiscript_engine.hpp | 2 +- .../chaiscript/language/chaiscript_eval.hpp | 112 +++++++++--------- .../chaiscript/language/chaiscript_parser.hpp | 4 +- samples/example.cpp | 4 +- src/multithreaded.cpp | 4 +- src/reflection.cpp | 10 +- unittests/boxed_cast_test.cpp | 20 ++-- unittests/multifile_test_chai.cpp | 2 +- unittests/multifile_test_chai.hpp | 4 +- unittests/multifile_test_main.cpp | 2 +- 25 files changed, 183 insertions(+), 183 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6ffca2..d6c77af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if(MSVC) add_definitions(/bigobj) endif() else() - add_definitions(-Wall -Wextra -Wshadow -pedantic) + add_definitions(-Wall -Wextra -Wshadow -pedantic -std=c++0x) if (APPLE) # -Wno-missing-field-initializers is for boost on macos diff --git a/include/chaiscript/chaiscript.hpp b/include/chaiscript/chaiscript.hpp index 0f17284..56611f3 100644 --- a/include/chaiscript/chaiscript.hpp +++ b/include/chaiscript/chaiscript.hpp @@ -297,8 +297,8 @@ ///
/// \subsection pointerconversions Pointer / Object Conversions /// -/// As much as possible, ChaiScript attempts to convert between &, *, const &, const *, boost::shared_ptr, -/// boost::shared_ptr, boost::reference_wrapper, boost::reference_wrapper and value types automatically. +/// As much as possible, ChaiScript attempts to convert between &, *, const &, const *, std::shared_ptr, +/// std::shared_ptr, boost::reference_wrapper, boost::reference_wrapper and value types automatically. /// /// If a chaiscript::var object was created in C++ from a pointer, it cannot be convered to a shared_ptr (this would add invalid reference counting). /// Const may be added, but never removed. @@ -311,10 +311,10 @@ /// void fun3(int); /// void fun4(int &); /// void fun5(const int &); -/// void fun5(boost::shared_ptr); -/// void fun6(boost::shared_ptr); -/// void fun7(const boost::shared_ptr &); -/// void fun8(const boost::shared_ptr &); +/// void fun5(std::shared_ptr); +/// void fun6(std::shared_ptr); +/// void fun7(const std::shared_ptr &); +/// void fun8(const std::shared_ptr &); /// void fun9(boost::reference_wrapper); /// void fun10(boost::reference_wrapper); /// diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index d61f338..5427ac8 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -25,9 +25,9 @@ namespace chaiscript /// \param[in] v Boxed_Number to copy into the new object /// \returns The newly created object. template - boost::shared_ptr construct_pod(Boxed_Number v) + std::shared_ptr construct_pod(Boxed_Number v) { - boost::shared_ptr p(new P1()); + std::shared_ptr p(new P1()); Boxed_Value bv(p); Boxed_Number nb(bv); nb = v; @@ -139,7 +139,7 @@ namespace chaiscript * function variables. */ template - boost::shared_ptr shared_ptr_clone(const boost::shared_ptr &p) + std::shared_ptr shared_ptr_clone(const std::shared_ptr &p) { return p; } @@ -148,8 +148,8 @@ namespace chaiscript * Specific version of shared_ptr_clone just for Proxy_Functions */ template - boost::shared_ptr::type> - shared_ptr_unconst_clone(const boost::shared_ptr::type> &p) + std::shared_ptr::type> + shared_ptr_unconst_clone(const std::shared_ptr::type> &p) { return boost::const_pointer_cast::type>(p); } @@ -162,7 +162,7 @@ namespace chaiscript * Similar to shared_ptr_clone. Used for Proxy_Function. */ template - Boxed_Value ptr_assign(Boxed_Value lhs, const boost::shared_ptr &rhs) + Boxed_Value ptr_assign(Boxed_Value lhs, const std::shared_ptr &rhs) { if (lhs.is_undef() || (!lhs.get_type_info().is_const() && lhs.get_type_info().bare_equal(chaiscript::detail::Get_Type_Info::get()))) @@ -283,7 +283,7 @@ namespace chaiscript static bool has_guard(const Const_Proxy_Function &t_pf) { - boost::shared_ptr pf = boost::dynamic_pointer_cast(t_pf); + std::shared_ptr pf = std::dynamic_pointer_cast(t_pf); if (pf) { return pf->get_guard(); @@ -294,7 +294,7 @@ namespace chaiscript static Const_Proxy_Function get_guard(const Const_Proxy_Function &t_pf) { - boost::shared_ptr pf = boost::dynamic_pointer_cast(t_pf); + std::shared_ptr pf = std::dynamic_pointer_cast(t_pf); if (pf) { if (pf->get_guard()) @@ -312,7 +312,7 @@ namespace chaiscript throw bv; } - static boost::shared_ptr bootstrap2(boost::shared_ptr e = boost::shared_ptr (new chaiscript::detail::Dispatch_Engine())) + static std::shared_ptr bootstrap2(std::shared_ptr e = std::shared_ptr (new chaiscript::detail::Dispatch_Engine())) { e->add(user_type(), "void"); return e; diff --git a/include/chaiscript/dispatchkit/boxed_cast.hpp b/include/chaiscript/dispatchkit/boxed_cast.hpp index e082ce3..ea188bb 100644 --- a/include/chaiscript/dispatchkit/boxed_cast.hpp +++ b/include/chaiscript/dispatchkit/boxed_cast.hpp @@ -31,7 +31,7 @@ namespace chaiscript /// \returns Type equivalent to the requested type /// \throws exception::bad_boxed_cast If the requested conversion is not possible /// - /// boxed_cast will attempt to make conversions between value, &, *, boost::shared_ptr, boost::reference_wrapper, + /// boxed_cast will attempt to make conversions between value, &, *, std::shared_ptr, boost::reference_wrapper, /// and boost::function (const and non-const) where possible. boxed_cast is used internally during function /// dispatch. This means that all of these conversions will be attempted automatically for you during /// ChaiScript function calls. @@ -40,8 +40,8 @@ namespace chaiscript /// \li const values can be extracted only as const /// \li Boxed_Value constructed from pointer or boost::reference_wrapper can be extracted as reference, /// pointer or value types - /// \li Boxed_Value constructed from boost::shared_ptr or value types can be extracted as reference, - /// pointer, value, or boost::shared_ptr types + /// \li Boxed_Value constructed from std::shared_ptr or value types can be extracted as reference, + /// pointer, value, or std::shared_ptr types /// /// Conversions to boost::function objects are attempted as well /// @@ -49,11 +49,11 @@ namespace chaiscript /// \code /// // All of the following should succeed /// chaiscript::Boxed_Value bv(1); - /// boost::shared_ptr spi = chaiscript::boxed_cast >(bv); + /// std::shared_ptr spi = chaiscript::boxed_cast >(bv); /// int i = chaiscript::boxed_cast(bv); /// int *ip = chaiscript::boxed_cast(bv); /// int &ir = chaiscript::boxed_cast(bv); - /// boost::shared_ptr cspi = chaiscript::boxed_cast >(bv); + /// std::shared_ptr cspi = chaiscript::boxed_cast >(bv); /// const int ci = chaiscript::boxed_cast(bv); /// const int *cip = chaiscript::boxed_cast(bv); /// const int &cir = chaiscript::boxed_cast(bv); diff --git a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp index ceb0178..c6e8338 100644 --- a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp +++ b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp @@ -42,9 +42,9 @@ namespace chaiscript } else { if (!ob.get_type_info().is_const()) { - return boost::cref(*(boost::any_cast >(ob.get()))); + return boost::cref(*(boost::any_cast >(ob.get()))); } else { - return boost::cref(*(boost::any_cast >(ob.get()))); + return boost::cref(*(boost::any_cast >(ob.get()))); } } } @@ -84,9 +84,9 @@ namespace chaiscript } else { if (!ob.get_type_info().is_const()) { - return (boost::any_cast >(ob.get())).get(); + return (boost::any_cast >(ob.get())).get(); } else { - return (boost::any_cast >(ob.get())).get(); + return (boost::any_cast >(ob.get())).get(); } } } @@ -106,7 +106,7 @@ namespace chaiscript { return (boost::any_cast >(ob.get())).get_pointer(); } else { - return (boost::any_cast >(ob.get())).get(); + return (boost::any_cast >(ob.get())).get(); } } }; @@ -125,68 +125,68 @@ namespace chaiscript { return boost::any_cast >(ob.get()); } else { - return boost::ref(*(boost::any_cast >(ob.get()))); + return boost::ref(*(boost::any_cast >(ob.get()))); } } }; /** - * Cast_Helper_Inner for casting to a boost::shared_ptr<> type + * Cast_Helper_Inner for casting to a std::shared_ptr<> type */ template - struct Cast_Helper_Inner > + struct Cast_Helper_Inner > { - typedef typename boost::shared_ptr Result_Type; + typedef typename std::shared_ptr Result_Type; static Result_Type cast(const Boxed_Value &ob) { - return boost::any_cast >(ob.get()); + return boost::any_cast >(ob.get()); } }; /** - * Cast_Helper_Inner for casting to a boost::shared_ptr type + * Cast_Helper_Inner for casting to a std::shared_ptr type */ template - struct Cast_Helper_Inner > + struct Cast_Helper_Inner > { - typedef typename boost::shared_ptr Result_Type; + typedef typename std::shared_ptr Result_Type; static Result_Type cast(const Boxed_Value &ob) { if (!ob.get_type_info().is_const()) { - return boost::const_pointer_cast(boost::any_cast >(ob.get())); + return boost::const_pointer_cast(boost::any_cast >(ob.get())); } else { - return boost::any_cast >(ob.get()); + return boost::any_cast >(ob.get()); } } }; /** - * Cast_Helper_Inner for casting to a const boost::shared_ptr<> & type + * Cast_Helper_Inner for casting to a const std::shared_ptr<> & type */ template - struct Cast_Helper_Inner > : Cast_Helper_Inner > + struct Cast_Helper_Inner > : Cast_Helper_Inner > { }; template - struct Cast_Helper_Inner &> : Cast_Helper_Inner > + struct Cast_Helper_Inner &> : Cast_Helper_Inner > { }; /** - * Cast_Helper_Inner for casting to a const boost::shared_ptr & type + * Cast_Helper_Inner for casting to a const std::shared_ptr & type */ template - struct Cast_Helper_Inner > : Cast_Helper_Inner > + struct Cast_Helper_Inner > : Cast_Helper_Inner > { }; template - struct Cast_Helper_Inner &> : Cast_Helper_Inner > + struct Cast_Helper_Inner &> : Cast_Helper_Inner > { }; diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index d49931f..6eb1eac 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -71,14 +71,14 @@ namespace chaiscript void *m_data_ptr; const void *m_const_data_ptr; bool m_is_ref; - std::vector > m_dependencies; + std::vector > m_dependencies; }; struct Object_Data { - static boost::shared_ptr get(Boxed_Value::Void_Type) + static std::shared_ptr get(Boxed_Value::Void_Type) { - return boost::shared_ptr (new Data( + return std::shared_ptr (new Data( detail::Get_Type_Info::get(), boost::any(), false, @@ -87,15 +87,15 @@ namespace chaiscript } template - static boost::shared_ptr get(const boost::shared_ptr *obj) + static std::shared_ptr get(const std::shared_ptr *obj) { return get(*obj); } template - static boost::shared_ptr get(const boost::shared_ptr &obj) + static std::shared_ptr get(const std::shared_ptr &obj) { - return boost::shared_ptr(new Data( + return std::shared_ptr(new Data( detail::Get_Type_Info::get(), boost::any(obj), false, @@ -104,15 +104,15 @@ namespace chaiscript } template - static boost::shared_ptr get(T *t) + static std::shared_ptr get(T *t) { return get(boost::ref(*t)); } template - static boost::shared_ptr get(boost::reference_wrapper obj) + static std::shared_ptr get(boost::reference_wrapper obj) { - return boost::shared_ptr(new Data( + return std::shared_ptr(new Data( detail::Get_Type_Info::get(), boost::any(obj), true, @@ -121,10 +121,10 @@ namespace chaiscript } template - static boost::shared_ptr get(const T& t) + static std::shared_ptr get(const T& t) { - boost::shared_ptr p(new T(t)); - return boost::shared_ptr(new Data( + std::shared_ptr p(new T(t)); + return std::shared_ptr(new Data( detail::Get_Type_Info::get(), boost::any(p), false, @@ -132,9 +132,9 @@ namespace chaiscript ); } - static boost::shared_ptr get() + static std::shared_ptr get() { - return boost::shared_ptr (new Data( + return std::shared_ptr (new Data( Type_Info(), boost::any(), false, @@ -271,10 +271,10 @@ namespace chaiscript } private: - boost::shared_ptr m_data; + std::shared_ptr m_data; }; - /// \brief Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, boost::shared_ptr, or boost::reference_type + /// \brief Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, std::shared_ptr, or boost::reference_type /// a copy is not made. /// \param t The value to box /// @@ -301,7 +301,7 @@ namespace chaiscript template Boxed_Value const_var_impl(const T &t) { - return Boxed_Value(boost::shared_ptr::type >(new T(t))); + return Boxed_Value(std::shared_ptr::type >(new T(t))); } /// \brief Takes a pointer to a value, adds const to the pointed to type and returns an immutable Boxed_Value. @@ -315,13 +315,13 @@ namespace chaiscript return Boxed_Value( const_cast::type *>(t) ); } - /// \brief Takes a boost::shared_ptr to a value, adds const to the pointed to type and returns an immutable Boxed_Value. + /// \brief Takes a std::shared_ptr to a value, adds const to the pointed to type and returns an immutable Boxed_Value. /// Does not copy the pointed to value. /// \param[in] t Pointer to make immutable /// \returns Immutable Boxed_Value /// \sa Boxed_Value::is_const template - Boxed_Value const_var_impl(const boost::shared_ptr &t) + Boxed_Value const_var_impl(const std::shared_ptr &t) { return Boxed_Value( boost::const_pointer_cast::type>(t) ); } diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index b96d53a..0dd657a 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -118,7 +118,7 @@ namespace chaiscript return *this; } - Module &add(const boost::shared_ptr &m) + Module &add(const std::shared_ptr &m) { m->apply(*this, *this); return *m; @@ -183,7 +183,7 @@ namespace chaiscript }; /// Convenience typedef for Module objects to be added to the ChaiScript runtime - typedef boost::shared_ptr ModulePtr; + typedef std::shared_ptr ModulePtr; namespace detail { @@ -346,7 +346,7 @@ namespace chaiscript typedef std::map Type_Name_Map; typedef std::map Scope; typedef std::deque StackData; - typedef boost::shared_ptr Stack; + typedef std::shared_ptr Stack; struct State { @@ -357,7 +357,7 @@ namespace chaiscript }; Dispatch_Engine() - : m_place_holder(boost::shared_ptr(new dispatch::Placeholder_Object())) + : m_place_holder(std::shared_ptr(new dispatch::Placeholder_Object())) { } @@ -838,8 +838,8 @@ namespace chaiscript const Type_Info boxed_type = user_type(); const Type_Info boxed_pod_type = user_type(); - boost::shared_ptr dynamic_lhs(boost::dynamic_pointer_cast(lhs)); - boost::shared_ptr dynamic_rhs(boost::dynamic_pointer_cast(rhs)); + std::shared_ptr dynamic_lhs(std::dynamic_pointer_cast(lhs)); + std::shared_ptr dynamic_rhs(std::dynamic_pointer_cast(rhs)); if (dynamic_lhs && dynamic_rhs) { diff --git a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp index dd14ff8..5d66f29 100644 --- a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp +++ b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp @@ -87,8 +87,8 @@ namespace chaiscript // Dynamic cast out the contained boxed value, which we know is the type we want if (t_derived.is_const()) { - boost::shared_ptr data - = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); + std::shared_ptr data + = std::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); if (!data) { throw std::bad_cast(); @@ -96,8 +96,8 @@ namespace chaiscript return Boxed_Value(data); } else { - boost::shared_ptr data - = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); + std::shared_ptr data + = std::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived)); if (!data) { @@ -136,9 +136,9 @@ namespace chaiscript } template - static boost::shared_ptr create() + static std::shared_ptr create() { - boost::shared_ptr conversion(new Dynamic_Conversion_Impl()); + std::shared_ptr conversion(new Dynamic_Conversion_Impl()); /// \todo this is a hack and a kludge. The idea is to make sure that /// the conversion is registered both in the module's notion of the static conversion object @@ -165,7 +165,7 @@ namespace chaiscript } } - void add_conversion(const boost::shared_ptr &conversion) + void add_conversion(const std::shared_ptr &conversion) { chaiscript::detail::threading::unique_lock l(m_mutex); @@ -219,7 +219,7 @@ namespace chaiscript }; } - typedef boost::shared_ptr Dynamic_Cast_Conversion; + typedef std::shared_ptr Dynamic_Cast_Conversion; /// \brief Used to register a base / parent class relationship with ChaiScript. Necessary if you /// want automatic conversions up your inheritance hierarchy. diff --git a/include/chaiscript/dispatchkit/exception_specification.hpp b/include/chaiscript/dispatchkit/exception_specification.hpp index 4c0d19a..ff169c3 100644 --- a/include/chaiscript/dispatchkit/exception_specification.hpp +++ b/include/chaiscript/dispatchkit/exception_specification.hpp @@ -128,7 +128,7 @@ namespace chaiscript /// /// \sa chaiscript::exception_specification for creation of chaiscript::Exception_Handler objects /// \sa \ref exceptions - typedef boost::shared_ptr Exception_Handler; + typedef std::shared_ptr Exception_Handler; /// \brief creates a chaiscript::Exception_Handler which handles one type of exception unboxing /// \sa \ref exceptions diff --git a/include/chaiscript/dispatchkit/function_call_detail.hpp b/include/chaiscript/dispatchkit/function_call_detail.hpp index 49a877a..e7e7b91 100644 --- a/include/chaiscript/dispatchkit/function_call_detail.hpp +++ b/include/chaiscript/dispatchkit/function_call_detail.hpp @@ -95,8 +95,8 @@ namespace chaiscript { if (funcs.size() == 1) { - boost::shared_ptr > pfi = - boost::dynamic_pointer_cast > + std::shared_ptr > pfi = + std::dynamic_pointer_cast > (funcs[0]); if (pfi) diff --git a/include/chaiscript/dispatchkit/handle_return.hpp b/include/chaiscript/dispatchkit/handle_return.hpp index e9c3261..70cc02e 100644 --- a/include/chaiscript/dispatchkit/handle_return.hpp +++ b/include/chaiscript/dispatchkit/handle_return.hpp @@ -44,27 +44,27 @@ namespace chaiscript }; template - struct Handle_Return &> + struct Handle_Return &> { - static Boxed_Value handle(const boost::shared_ptr &r) + static Boxed_Value handle(const std::shared_ptr &r) { return Boxed_Value(r); } }; template - struct Handle_Return > + struct Handle_Return > { - static Boxed_Value handle(const boost::shared_ptr &r) + static Boxed_Value handle(const std::shared_ptr &r) { return Boxed_Value(r); } }; template - struct Handle_Return &> + struct Handle_Return &> { - static Boxed_Value handle(const boost::shared_ptr &r) + static Boxed_Value handle(const std::shared_ptr &r) { return Boxed_Value(r); } diff --git a/include/chaiscript/dispatchkit/proxy_constructors.hpp b/include/chaiscript/dispatchkit/proxy_constructors.hpp index fcd019b..6c6e542 100644 --- a/include/chaiscript/dispatchkit/proxy_constructors.hpp +++ b/include/chaiscript/dispatchkit/proxy_constructors.hpp @@ -55,9 +55,9 @@ namespace chaiscript * of a given type with a given set of params */ template - boost::shared_ptr constructor_( BOOST_PP_ENUM_BINARY_PARAMS(n, Param, p) ) + std::shared_ptr constructor_( BOOST_PP_ENUM_BINARY_PARAMS(n, Param, p) ) { - return boost::shared_ptr(new Class( BOOST_PP_ENUM_PARAMS(n, p) )); + return std::shared_ptr(new Class( BOOST_PP_ENUM_PARAMS(n, p) )); } /** @@ -69,7 +69,7 @@ namespace chaiscript template Proxy_Function build_constructor_(Class (*)(BOOST_PP_ENUM_PARAMS(n, Param))) { - typedef boost::shared_ptr (sig)(BOOST_PP_ENUM_PARAMS(n, Param)); + typedef std::shared_ptr (sig)(BOOST_PP_ENUM_PARAMS(n, Param)); return Proxy_Function(new Proxy_Function_Impl(boost::function(&(constructor_)))); } } diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp index b6bb7e0..300a021 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 std::shared_ptr AST_NodePtr; namespace dispatch @@ -87,9 +87,9 @@ namespace chaiscript virtual bool operator==(const Proxy_Function_Base &) const = 0; virtual bool call_match(const std::vector &vals) const = 0; - virtual std::vector > get_contained_functions() const + virtual std::vector > get_contained_functions() const { - return std::vector >(); + return std::vector >(); } @@ -142,7 +142,7 @@ namespace chaiscript && (ti.bare_equal(user_type()) || ti.bare_equal(bv.get_type_info()) || chaiscript::detail::dynamic_cast_converts(ti, bv.get_type_info()) - || bv.get_type_info().bare_equal(user_type >()) + || bv.get_type_info().bare_equal(user_type >()) ) ) ) @@ -176,11 +176,11 @@ namespace chaiscript } /// \brief Common typedef used for passing of any registered function in ChaiScript - typedef boost::shared_ptr Proxy_Function; + typedef std::shared_ptr Proxy_Function; /// \brief Const version of Proxy_Function chaiscript. Points to a const Proxy_Function. This is how most registered functions /// are handled internally. - typedef boost::shared_ptr Const_Proxy_Function; + typedef std::shared_ptr Const_Proxy_Function; namespace exception { diff --git a/include/chaiscript/dispatchkit/type_info.hpp b/include/chaiscript/dispatchkit/type_info.hpp index 8bd0b9a..d1f7be5 100644 --- a/include/chaiscript/dispatchkit/type_info.hpp +++ b/include/chaiscript/dispatchkit/type_info.hpp @@ -157,7 +157,7 @@ namespace chaiscript }; template - struct Get_Type_Info > + struct Get_Type_Info > { typedef T type; @@ -166,13 +166,13 @@ namespace chaiscript return Type_Info(boost::is_const::value, boost::is_reference::value, boost::is_pointer::value, boost::is_void::value, boost::is_arithmetic::value && !boost::is_same::type, bool>::value, - &typeid(boost::shared_ptr ), + &typeid(std::shared_ptr ), &typeid(typename Bare_Type::type)); } }; template - struct Get_Type_Info &> + struct Get_Type_Info &> { typedef T type; @@ -181,7 +181,7 @@ namespace chaiscript return Type_Info(boost::is_const::value, boost::is_reference::value, boost::is_pointer::value, boost::is_void::value, boost::is_arithmetic::value && !boost::is_same::type, bool>::value, - &typeid(const boost::shared_ptr &), + &typeid(const std::shared_ptr &), &typeid(typename Bare_Type::type)); } }; diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index 7b21f52..40c4e8e 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -55,7 +55,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 std::shared_ptr AST_NodePtr; /// \brief Classes which may be thrown during error cases when ChaiScript is executing. @@ -106,7 +106,7 @@ namespace chaiscript public: const std::string text; const int identifier; - boost::shared_ptr filename; + std::shared_ptr filename; File_Position start, end; std::vector children; AST_NodePtr annotation; @@ -147,14 +147,14 @@ namespace chaiscript } protected: - AST_Node(const std::string &t_ast_node_text, int t_id, const boost::shared_ptr &t_fname, + AST_Node(const std::string &t_ast_node_text, int t_id, const std::shared_ptr &t_fname, int t_start_line, int t_start_col, int t_end_line, int t_end_col) : text(t_ast_node_text), identifier(t_id), filename(t_fname), start(t_start_line, t_start_col), end(t_end_line, t_end_col) { } - AST_Node(const std::string &t_ast_node_text, int t_id, const boost::shared_ptr &t_fname) : + AST_Node(const std::string &t_ast_node_text, int t_id, const std::shared_ptr &t_fname) : text(t_ast_node_text), identifier(t_id), filename(t_fname) {} virtual ~AST_Node() {} diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 86246db..1b866d8 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -231,7 +231,7 @@ namespace chaiscript #endif #endif - typedef boost::shared_ptr Loadable_Module_Ptr; + typedef std::shared_ptr Loadable_Module_Ptr; } diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index bd2ee1a..15cc6e7 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -38,7 +38,7 @@ namespace chaiscript struct Binary_Operator_AST_Node : public AST_Node { public: - Binary_Operator_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Xor, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Binary_Operator_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Xor, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } @@ -75,7 +75,7 @@ namespace chaiscript struct Error_AST_Node : public AST_Node { public: - Error_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Error, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Error_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Error, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Error_AST_Node() {} @@ -83,7 +83,7 @@ namespace chaiscript struct Int_AST_Node : public AST_Node { public: - Int_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Int, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Int_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Int, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col), m_value(const_var(int(atoi(t_ast_node_text.c_str())))) { } virtual ~Int_AST_Node() {} @@ -98,7 +98,7 @@ namespace chaiscript struct Float_AST_Node : public AST_Node { public: - Float_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Float, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Float_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Float, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col), m_value(const_var(double(atof(t_ast_node_text.c_str())))) { } virtual ~Float_AST_Node() {} @@ -113,7 +113,7 @@ namespace chaiscript struct Id_AST_Node : public AST_Node { public: - Id_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Id, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Id_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Id, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col), m_value(get_value(t_ast_node_text)) { } @@ -157,28 +157,28 @@ namespace chaiscript struct Char_AST_Node : public AST_Node { public: - Char_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Char, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Char_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Char, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Char_AST_Node() {} }; struct Str_AST_Node : public AST_Node { public: - Str_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Str, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Str_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Str, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Str_AST_Node() {} }; struct Eol_AST_Node : public AST_Node { public: - Eol_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Eol, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Eol_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Eol, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Eol_AST_Node() {} }; struct Fun_Call_AST_Node : public AST_Node { public: - Fun_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Fun_Call, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Fun_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Fun_Call, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Fun_Call_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -226,7 +226,7 @@ namespace chaiscript struct Inplace_Fun_Call_AST_Node : public AST_Node { public: - Inplace_Fun_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inplace_Fun_Call, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Inplace_Fun_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inplace_Fun_Call, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Inplace_Fun_Call_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -256,21 +256,21 @@ namespace chaiscript struct Arg_List_AST_Node : public AST_Node { public: - Arg_List_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Arg_List, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Arg_List_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Arg_List, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Arg_List_AST_Node() {} }; struct Variable_AST_Node : public AST_Node { public: - Variable_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Variable, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Variable_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Variable, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Variable_AST_Node() {} }; struct Equation_AST_Node : public AST_Node { public: - Equation_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Equation, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Equation_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Equation, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) {} @@ -331,7 +331,7 @@ namespace chaiscript struct Var_Decl_AST_Node : public AST_Node { public: - Var_Decl_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Var_Decl, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Var_Decl_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Var_Decl, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Var_Decl_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -348,7 +348,7 @@ namespace chaiscript struct Comparison_AST_Node : public Binary_Operator_AST_Node { public: - Comparison_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Comparison, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Comparison_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Comparison, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Comparison_AST_Node() {} }; @@ -356,7 +356,7 @@ namespace chaiscript struct Addition_AST_Node : public Binary_Operator_AST_Node { public: Addition_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Addition, - const boost::shared_ptr &t_fname=boost::shared_ptr(), + const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Addition_AST_Node() {} @@ -368,7 +368,7 @@ namespace chaiscript struct Subtraction_AST_Node : public Binary_Operator_AST_Node { public: Subtraction_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Subtraction, - const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, + const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Subtraction_AST_Node() {} @@ -380,7 +380,7 @@ namespace chaiscript struct Multiplication_AST_Node : public Binary_Operator_AST_Node { public: Multiplication_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Multiplication, - const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, + const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Multiplication_AST_Node() {} @@ -392,7 +392,7 @@ namespace chaiscript struct Division_AST_Node : public Binary_Operator_AST_Node { public: Division_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Division, - const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, + const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Division_AST_Node() {} @@ -404,7 +404,7 @@ namespace chaiscript struct Modulus_AST_Node : public Binary_Operator_AST_Node { public: Modulus_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Modulus, - const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, + const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Modulus_AST_Node() {} @@ -415,7 +415,7 @@ namespace chaiscript struct Array_Call_AST_Node : public AST_Node { public: - Array_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Array_Call, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Array_Call_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Array_Call, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Array_Call_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -439,7 +439,7 @@ namespace chaiscript struct Dot_Access_AST_Node : public AST_Node { public: - Dot_Access_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Dot_Access, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Dot_Access_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Dot_Access, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Dot_Access_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -507,7 +507,7 @@ namespace chaiscript struct Quoted_String_AST_Node : public AST_Node { public: - Quoted_String_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Quoted_String, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Quoted_String_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Quoted_String, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col), m_value(const_var(t_ast_node_text)) { } virtual ~Quoted_String_AST_Node() {} @@ -522,7 +522,7 @@ namespace chaiscript struct Single_Quoted_String_AST_Node : public AST_Node { public: - Single_Quoted_String_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Single_Quoted_String, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Single_Quoted_String_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Single_Quoted_String, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col), m_value(const_var(char(t_ast_node_text.at(0)))) { } virtual ~Single_Quoted_String_AST_Node() {} @@ -536,7 +536,7 @@ namespace chaiscript struct Lambda_AST_Node : public AST_Node { public: - Lambda_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Lambda, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Lambda_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Lambda, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Lambda_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -564,7 +564,7 @@ namespace chaiscript struct Block_AST_Node : public AST_Node { public: - Block_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Block, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Block_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Block, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Block_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -593,7 +593,7 @@ namespace chaiscript struct Def_AST_Node : public AST_Node { public: - Def_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Def, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Def_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Def, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Def_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -620,9 +620,9 @@ namespace chaiscript } } - boost::shared_ptr guard; + std::shared_ptr guard; if (guardnode) { - guard = boost::shared_ptr + guard = std::shared_ptr (new dispatch::Dynamic_Proxy_Function(boost::bind(chaiscript::eval::detail::eval_function, boost::ref(t_ss), guardnode, t_param_names, _1), static_cast(numparams), guardnode)); @@ -647,7 +647,7 @@ namespace chaiscript struct While_AST_Node : public AST_Node { public: - While_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::While, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + While_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::While, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~While_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) { @@ -683,7 +683,7 @@ namespace chaiscript struct If_AST_Node : public AST_Node { public: - If_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::If, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + If_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::If, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~If_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -728,7 +728,7 @@ namespace chaiscript struct For_AST_Node : public AST_Node { public: - For_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::For, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + For_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::For, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~For_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -778,7 +778,7 @@ namespace chaiscript struct Inline_Array_AST_Node : public AST_Node { public: - Inline_Array_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Array, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Inline_Array_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Array, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Inline_Array_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -796,7 +796,7 @@ namespace chaiscript struct Inline_Map_AST_Node : public AST_Node { public: - Inline_Map_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Map, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Inline_Map_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Map, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Inline_Map_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -817,7 +817,7 @@ namespace chaiscript struct Return_AST_Node : public AST_Node { public: - Return_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Return, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Return_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Return, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Return_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -833,7 +833,7 @@ namespace chaiscript struct File_AST_Node : public AST_Node { public: - File_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::File, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + File_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::File, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~File_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) { @@ -850,7 +850,7 @@ namespace chaiscript struct Prefix_AST_Node : public AST_Node { public: - Prefix_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Prefix, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Prefix_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Prefix, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } @@ -875,7 +875,7 @@ namespace chaiscript struct Break_AST_Node : public AST_Node { public: - Break_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Break, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Break_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Break, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Break_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &){ @@ -885,21 +885,21 @@ namespace chaiscript struct Map_Pair_AST_Node : public AST_Node { public: - Map_Pair_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Map_Pair, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Map_Pair_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Map_Pair, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Map_Pair_AST_Node() {} }; struct Value_Range_AST_Node : public AST_Node { public: - Value_Range_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Value_Range, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Value_Range_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Value_Range, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Value_Range_AST_Node() {} }; struct Inline_Range_AST_Node : public AST_Node { public: - Inline_Range_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Range, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Inline_Range_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Inline_Range, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Inline_Range_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -917,14 +917,14 @@ namespace chaiscript struct Annotation_AST_Node : public AST_Node { public: - Annotation_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Annotation, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Annotation_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Annotation, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Annotation_AST_Node() {} }; struct Try_AST_Node : public AST_Node { public: - Try_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Try, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Try_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Try, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Try_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -1051,21 +1051,21 @@ namespace chaiscript struct Catch_AST_Node : public AST_Node { public: - Catch_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Catch, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Catch_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Catch, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Catch_AST_Node() {} }; struct Finally_AST_Node : public AST_Node { public: - Finally_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Finally, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Finally_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Finally, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Finally_AST_Node() {} }; struct Method_AST_Node : public AST_Node { public: - Method_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Method, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Method_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Method, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Method_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -1095,9 +1095,9 @@ namespace chaiscript size_t numparams = t_param_names.size(); - boost::shared_ptr guard; + std::shared_ptr guard; if (guardnode) { - guard = boost::shared_ptr + guard = std::shared_ptr (new dispatch::Dynamic_Proxy_Function(boost::bind(chaiscript::eval::detail::eval_function, boost::ref(t_ss), guardnode, t_param_names, _1), static_cast(numparams), guardnode)); @@ -1142,7 +1142,7 @@ namespace chaiscript struct Attr_Decl_AST_Node : public AST_Node { public: - Attr_Decl_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Attr_Decl, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Attr_Decl_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Attr_Decl, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Attr_Decl_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -1161,42 +1161,42 @@ namespace chaiscript struct Shift_AST_Node : public Binary_Operator_AST_Node { public: - Shift_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Shift, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Shift_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Shift, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Shift_AST_Node() {} }; struct Equality_AST_Node : public Binary_Operator_AST_Node { public: - Equality_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Equality, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Equality_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Equality, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Equality_AST_Node() {} }; struct Bitwise_And_AST_Node : public Binary_Operator_AST_Node { public: - Bitwise_And_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_And, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Bitwise_And_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_And, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Bitwise_And_AST_Node() {} }; struct Bitwise_Xor_AST_Node : public Binary_Operator_AST_Node { public: - Bitwise_Xor_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Xor, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Bitwise_Xor_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Xor, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Bitwise_Xor_AST_Node() {} }; struct Bitwise_Or_AST_Node : public Binary_Operator_AST_Node { public: - Bitwise_Or_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Or, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Bitwise_Or_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Bitwise_Or, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : Binary_Operator_AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Bitwise_Or_AST_Node() {} }; struct Logical_And_AST_Node : public AST_Node { public: - Logical_And_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Logical_And, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Logical_And_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Logical_And, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Logical_And_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ @@ -1225,7 +1225,7 @@ namespace chaiscript struct Logical_Or_AST_Node : public AST_Node { public: - Logical_Or_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Logical_Or, const boost::shared_ptr &t_fname=boost::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : + Logical_Or_AST_Node(const std::string &t_ast_node_text = "", int t_id = AST_Node_Type::Logical_Or, const std::shared_ptr &t_fname=std::shared_ptr(), int t_start_line = 0, int t_start_col = 0, int t_end_line = 0, int t_end_col = 0) : AST_Node(t_ast_node_text, t_id, t_fname, t_start_line, t_start_col, t_end_line, t_end_col) { } virtual ~Logical_Or_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index 8db4b2e..aa10437 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -45,7 +45,7 @@ namespace chaiscript std::string m_multiline_comment_begin; std::string m_multiline_comment_end; std::string m_singleline_comment; - boost::shared_ptr m_filename; + std::shared_ptr m_filename; std::vector m_match_stack; bool m_alphabet[detail::max_alphabet][detail::lengthof_alphabet]; @@ -1978,7 +1978,7 @@ namespace chaiscript m_input_end = t_input.end(); m_line = 1; m_col = 1; - m_filename = boost::shared_ptr(new std::string(t_fname)); + m_filename = std::shared_ptr(new std::string(t_fname)); if ((t_input.size() > 1) && (t_input[0] == '#') && (t_input[1] == '!')) { while ((m_input_pos != m_input_end) && (!Eol())) { diff --git a/samples/example.cpp b/samples/example.cpp index 51ef10a..5b3cbbf 100644 --- a/samples/example.cpp +++ b/samples/example.cpp @@ -61,7 +61,7 @@ struct System } }; -void take_shared_ptr(const boost::shared_ptr &p) +void take_shared_ptr(const std::shared_ptr &p) { std::cout << *p << std::endl; } @@ -143,7 +143,7 @@ int main(int /*argc*/, char * /*argv*/[]) { log("Functor test output", boost::lexical_cast(x)); - chai.add(var(boost::shared_ptr()), "nullvar"); + chai.add(var(std::shared_ptr()), "nullvar"); chai("print(\"This should be true.\"); print(nullvar.is_var_null())"); // test the global const action diff --git a/src/multithreaded.cpp b/src/multithreaded.cpp index 52c9fbe..03e18b5 100644 --- a/src/multithreaded.cpp +++ b/src/multithreaded.cpp @@ -25,11 +25,11 @@ int main(int argc, char *argv[]) { //chai.add_shared_object(chaiscript::Boxed_Value(10000), "num_iterations"); - std::vector > threads; + std::vector > threads; for (int i = 0; i < argc - 1; ++i) { - threads.push_back(boost::shared_ptr(new boost::thread(boost::bind(do_work, boost::ref(chai))))); + threads.push_back(std::shared_ptr(new boost::thread(boost::bind(do_work, boost::ref(chai))))); } for (int i = 0; i < argc - 1; ++i) diff --git a/src/reflection.cpp b/src/reflection.cpp index 813362f..d465787 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -14,8 +14,8 @@ bool has_parse_tree(const chaiscript::Const_Proxy_Function &t_pf) { - boost::shared_ptr pf - = boost::dynamic_pointer_cast(t_pf); + std::shared_ptr pf + = std::dynamic_pointer_cast(t_pf); if (pf) { return pf->get_parse_tree(); @@ -26,8 +26,8 @@ bool has_parse_tree(const chaiscript::Const_Proxy_Function &t_pf) chaiscript::AST_NodePtr get_parse_tree(const chaiscript::Const_Proxy_Function &t_pf) { - boost::shared_ptr pf - = boost::dynamic_pointer_cast(t_pf); + std::shared_ptr pf + = std::dynamic_pointer_cast(t_pf); if (pf) { if (pf->get_parse_tree()) @@ -50,7 +50,7 @@ CHAISCRIPT_MODULE_EXPORT chaiscript::ModulePtr create_chaiscript_module_reflect m->add(chaiscript::fun(&get_parse_tree), "get_parse_tree"); - chaiscript::bootstrap::standard_library::vector_type > >("AST_NodeVector", m); + chaiscript::bootstrap::standard_library::vector_type > >("AST_NodeVector", m); CHAISCRIPT_CLASS_NO_CONSTRUCTOR( m, chaiscript::exception::eval_error, diff --git a/unittests/boxed_cast_test.cpp b/unittests/boxed_cast_test.cpp index 2e6edd9..5d5a5db 100644 --- a/unittests/boxed_cast_test.cpp +++ b/unittests/boxed_cast_test.cpp @@ -70,14 +70,14 @@ bool do_test(const Boxed_Value &bv, bool T, bool ConstT, bool TRef, bool ConstTR passed &= test_type_conversion(bv, ConstTPtr); passed &= test_type_conversion(bv, TPtrConst); passed &= test_type_conversion(bv, ConstTPtrConst); - passed &= test_type_conversion >(bv, SharedPtrT); - passed &= test_type_conversion >(bv, SharedConstPtrT); - passed &= test_type_conversion &>(bv, false); - passed &= test_type_conversion &>(bv, false); - passed &= test_type_conversion >(bv, ConstSharedPtrT); - passed &= test_type_conversion >(bv, ConstSharedConstPtrT); - passed &= test_type_conversion &>(bv, ConstSharedPtrTRef); - passed &= test_type_conversion &>(bv, ConstSharedPtrTConstRef); + passed &= test_type_conversion >(bv, SharedPtrT); + passed &= test_type_conversion >(bv, SharedConstPtrT); + passed &= test_type_conversion &>(bv, false); + passed &= test_type_conversion &>(bv, false); + passed &= test_type_conversion >(bv, ConstSharedPtrT); + passed &= test_type_conversion >(bv, ConstSharedConstPtrT); + passed &= test_type_conversion &>(bv, ConstSharedPtrTRef); + passed &= test_type_conversion &>(bv, ConstSharedPtrTConstRef); passed &= test_type_conversion >(bv, BoostRef); passed &= test_type_conversion >(bv, BoostConstRef); passed &= test_type_conversion &>(bv, false); @@ -205,7 +205,7 @@ bool built_in_type_test(const T &initial, bool ispod) /** shared_ptr tests **/ - boost::shared_ptr ip(new T(initial)); + std::shared_ptr ip(new T(initial)); passed &= do_test(var(ip), true, true, true, true, true, true, true, true, true, true, @@ -220,7 +220,7 @@ bool built_in_type_test(const T &initial, bool ispod) ispod && true, ispod && true, ispod && true, false, true); /** const shared_ptr tests **/ - boost::shared_ptr ipc(new T(initial)); + std::shared_ptr ipc(new T(initial)); passed &= do_test(var(ipc), true, true, false, true, false, true, false, true, false, true, diff --git a/unittests/multifile_test_chai.cpp b/unittests/multifile_test_chai.cpp index 57b8952..154062c 100644 --- a/unittests/multifile_test_chai.cpp +++ b/unittests/multifile_test_chai.cpp @@ -6,7 +6,7 @@ Multi_Test_Chai::Multi_Test_Chai() } -boost::shared_ptr Multi_Test_Chai::get_chai() +std::shared_ptr Multi_Test_Chai::get_chai() { return m_chai; } diff --git a/unittests/multifile_test_chai.hpp b/unittests/multifile_test_chai.hpp index 430b6bc..c2e306d 100644 --- a/unittests/multifile_test_chai.hpp +++ b/unittests/multifile_test_chai.hpp @@ -5,10 +5,10 @@ class Multi_Test_Chai public: Multi_Test_Chai(); - boost::shared_ptr get_chai(); + std::shared_ptr get_chai(); private: - boost::shared_ptr m_chai; + std::shared_ptr m_chai; }; diff --git a/unittests/multifile_test_main.cpp b/unittests/multifile_test_main.cpp index 8352ec8..94bbb6f 100644 --- a/unittests/multifile_test_main.cpp +++ b/unittests/multifile_test_main.cpp @@ -8,7 +8,7 @@ int main() Multi_Test_Chai chaitest; Multi_Test_Module chaimodule; - boost::shared_ptr chai = chaitest.get_chai(); + std::shared_ptr chai = chaitest.get_chai(); chai->add(chaimodule.get_module()); return chai->eval("get_module_value()"); }