diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ed23b8..ea0fc8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,11 +297,11 @@ if(BUILD_TESTING) add_executable(simultaneous_chaiscript_test unittests/simultaneous_chaiscript_test.cpp) target_link_libraries(simultaneous_chaiscript_test ${LIBS}) - add_test(NAME Simultaneous_Chaiscript_Test COMMAND simultaneous_chaiscript_test) + add_test(NAME Simultaneous_ChaiScript_Test COMMAND simultaneous_chaiscript_test) add_executable(heap_allocated_chaiscript_test unittests/heap_allocated_chaiscript_test.cpp) target_link_libraries(heap_allocated_chaiscript_test ${LIBS}) - add_test(NAME Heap_Allocated_Chaiscript_Test COMMAND heap_allocated_chaiscript_test) + add_test(NAME Heap_Allocated_ChaiScript_Test COMMAND heap_allocated_chaiscript_test) add_executable(c_linkage_test unittests/c_linkage_test.cpp) target_link_libraries(c_linkage_test ${LIBS}) diff --git a/contrib/geshi/chaiscript.php b/contrib/geshi/chaiscript.php index 06e4328..3c7ec7e 100644 --- a/contrib/geshi/chaiscript.php +++ b/contrib/geshi/chaiscript.php @@ -38,7 +38,7 @@ ************************************************************************************/ $language_data = array ( - 'LANG_NAME' => 'Chaiscript', + 'LANG_NAME' => 'ChaiScript', 'COMMENT_SINGLE' => array(1 => '//'), 'COMMENT_MULTI' => array('/*' => '*/'), //Regular Expressions diff --git a/include/chaiscript/chaiscript.hpp b/include/chaiscript/chaiscript.hpp index 3bc72cc..903eb38 100644 --- a/include/chaiscript/chaiscript.hpp +++ b/include/chaiscript/chaiscript.hpp @@ -39,10 +39,10 @@ /// - @ref basics /// - @ref compiling /// - @ref eval -/// - @ref addingitems +/// - @ref adding_items /// - @ref operatoroverloading /// - @ref add_class -/// - @ref pointerconversions +/// - @ref pointer_conversions /// - @ref baseclasses /// - @ref functionobjects /// - @ref threading @@ -138,11 +138,11 @@ /// /// -------------------------------------------------- /// -/// @subsection addingitems Adding Items to ChaiScript +/// @subsection adding_items Adding Items to ChaiScript /// /// ChaiScript supports 4 basic things that can be added: objects, functions, type infos and Modules /// -/// @subsubsection addingobjects Adding Objects +/// @subsubsection adding_objects Adding Objects /// /// Named objects can be created with the chaiscript::var function. Note: adding a object /// adds it to the current thread scope, not to a global scope. If you have multiple @@ -173,7 +173,7 @@ /// chai("def somefun() { print(i); }; sumfun();"); /// ~~~~~~~~~ /// -/// @subsubsection addingfunctions Adding Functions +/// @subsubsection adding_functions Adding Functions /// /// Functions, methods and members are all added using the same function: chaiscript::fun. /// @@ -227,7 +227,7 @@ /// chai.add(user_type(), "MyClass"); /// ~~~~~~~~ /// -/// @subsubsection addingmodules Adding Modules +/// @subsubsection adding_modules Adding Modules /// /// Modules are holders for collections of ChaiScript registrations. /// @@ -261,7 +261,7 @@ /// chai.add(fun(append_string_int), "+"); /// ~~~~~~~~ /// -/// @sa @ref addingfunctions +/// @sa @ref adding_functions /// /// ----------------------------------------------------------------------- /// @@ -302,11 +302,11 @@ /// } /// ~~~~~~~~ /// -/// @sa @ref addingmodules +/// @sa @ref adding_modules /// /// ----------------------------------------------------------------------- /// -/// @subsection pointerconversions Pointer / Object Conversions +/// @subsection pointer_conversions Pointer / Object Conversions /// /// As much as possible, ChaiScript attempts to convert between &, *, const &, const *, std::shared_ptr, /// std::shared_ptr, std::reference_wrapper, std::reference_wrapper and value types automatically. @@ -389,7 +389,7 @@ /// /// @subsection functionobjects Function Objects /// -/// Functions are first class objects in Chaiscript and ChaiScript supports automatic conversion +/// Functions are first class objects in ChaiScript and ChaiScript supports automatic conversion /// between ChaiScript functions and std::function objects. /// /// ~~~~~~~~{.cpp} @@ -614,8 +614,8 @@ /// /// ~~~~~~~~ /// eval> def callfunc(f, lhs, rhs) { return f(lhs, rhs); } -/// eval> def dosomething(lhs, rhs) { print("lhs: ${lhs}, rhs: ${rhs}"); } -/// eval> callfunc(dosomething, 1, 2); +/// eval> def do_something(lhs, rhs) { print("lhs: ${lhs}, rhs: ${rhs}"); } +/// eval> callfunc(do_something, 1, 2); /// lhs: 1, rhs: 2 /// ~~~~~~~~ /// diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 0071d61..ecf3743 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -334,8 +334,8 @@ namespace chaiscript push_back_name = "push_back"; } - typedef void (ContainerType::*pushback)(const typename ContainerType::value_type &); - m->add(fun(static_cast(&ContainerType::push_back)), push_back_name); + typedef void (ContainerType::*push_back)(const typename ContainerType::value_type &); + m->add(fun(static_cast(&ContainerType::push_back)), push_back_name); m->add(fun(&ContainerType::pop_back), "pop_back"); return m; } diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index 9cc7502..006815b 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -254,7 +254,7 @@ namespace chaiscript /// chai.add(chaiscript::var(&i), "ip"); /// ~~~ /// - /// @sa @ref addingobjects + /// @sa @ref adding_objects template Boxed_Value var(T t) { @@ -328,7 +328,7 @@ namespace chaiscript /// \endcode /// /// \todo support C++11 strongly typed enums - /// \sa \ref addingobjects + /// \sa \ref adding_objects template Boxed_Value const_var(const T &t) { diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index a4886ce..72a38fb 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -365,7 +365,7 @@ namespace chaiscript ++begin; - bool sizemismatch = false; + bool size_mismatch = false; while (begin != end) { @@ -373,7 +373,7 @@ namespace chaiscript if (param_types.size() != type_infos.size()) { - sizemismatch = true; + size_mismatch = true; } for (size_t i = 0; i < type_infos.size() && i < param_types.size(); ++i) @@ -389,7 +389,7 @@ namespace chaiscript assert(type_infos.size() > 0 && " type_info vector size is < 0, this is only possible if something else is broken"); - if (sizemismatch) + if (size_mismatch) { type_infos.resize(1); } diff --git a/include/chaiscript/dispatchkit/register_function.hpp b/include/chaiscript/dispatchkit/register_function.hpp index 987aba0..a664922 100644 --- a/include/chaiscript/dispatchkit/register_function.hpp +++ b/include/chaiscript/dispatchkit/register_function.hpp @@ -96,7 +96,7 @@ namespace chaiscript /// chai.add(fun(&MyClass::memberdata), "memberdata"); /// \endcode /// - /// \sa \ref addingfunctions + /// \sa \ref adding_functions template Proxy_Function fun(T t) { @@ -114,7 +114,7 @@ namespace chaiscript /// chai.add(fun(f), "some_function"); /// \endcode /// - /// \sa \ref addingfunctions + /// \sa \ref adding_functions template Proxy_Function fun(const std::function &f) { @@ -139,7 +139,7 @@ namespace chaiscript /// chai.add(fun(&MyClass::memberfunction, std::ref(obj)), "memberfunction"); /// \endcode /// - /// \sa \ref addingfunctions + /// \sa \ref adding_functions template Proxy_Function fun(T t, const Q &q) { @@ -165,7 +165,7 @@ namespace chaiscript /// chai.add(fun(&MyClass::memberfunction, std::ref(obj), 1), "memberfunction"); /// \endcode /// - /// \sa \ref addingfunctions + /// \sa \ref adding_functions template Proxy_Function fun(T t, const Q &q, const R &r) { diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index aef4e81..63fe16c 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -530,7 +530,7 @@ namespace chaiscript chaiscript::detail::Dispatch_Engine &m_de; }; - /// Creates a new functon call and pops it on destruction + /// Creates a new function call and pops it on destruction struct Function_Push_Pop { Function_Push_Pop(chaiscript::detail::Dispatch_Engine &t_de) diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index a5cb129..30b35c9 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -140,32 +140,32 @@ namespace chaiscript struct Loadable_Module { template - static std::wstring towstring(const T &t_str) + static std::wstring to_wstring(const T &t_str) { return std::wstring(t_str.begin(), t_str.end()); } template - static std::string tostring(const T &t_str) + static std::string to_string(const T &t_str) { return std::string(t_str.begin(), t_str.end()); } #ifdef _UNICODE template - static std::wstring toproperstring(const T &t_str) + static std::wstring to_proper_string(const T &t_str) { - return towstring(t_str); + return to_wstring(t_str); } #else template - static std::string toproperstring(const T &t_str) + static std::string to_proper_string(const T &t_str) { - return tostring(t_str); + return to_string(t_str); } #endif - static std::string GetErrorMessage(DWORD t_err) + static std::string get_error_message(DWORD t_err) { #ifdef _UNICODE typedef LPWSTR StringType; @@ -190,17 +190,17 @@ namespace chaiscript LocalFree(lpMsgBuf); } - return tostring(retval); + return to_string(retval); } struct DLModule { DLModule(const std::string &t_filename) - : m_data(LoadLibrary(toproperstring(t_filename).c_str())) + : m_data(LoadLibrary(to_proper_string(t_filename).c_str())) { if (!m_data) { - throw chaiscript::exception::load_module_error(GetErrorMessage(GetLastError())); + throw chaiscript::exception::load_module_error(get_error_message(GetLastError())); } } @@ -220,7 +220,7 @@ namespace chaiscript { if (!m_symbol) { - throw chaiscript::exception::load_module_error(GetErrorMessage(GetLastError())); + throw chaiscript::exception::load_module_error(get_error_message(GetLastError())); } } @@ -366,7 +366,6 @@ namespace chaiscript m_engine.add(fun(&ChaiScript::version_patch, this), "version_patch"); m_engine.add(fun(&ChaiScript::version, this), "version"); - do_eval(ChaiScript_Prelude::chaiscript_prelude(), "standard prelude"); } @@ -647,7 +646,7 @@ namespace chaiscript /// chai.add(chaiscript::var(&obj), "obj"); // Add a pointer to a locally defined object /// \endcode /// - /// \sa \ref addingitems + /// \sa \ref adding_items template ChaiScript &add(const T &t_t, const std::string &t_name) { @@ -713,12 +712,12 @@ namespace chaiscript for (auto & elem : m_modulepaths) { - for (auto & prefixe : prefixes) + for (auto & prefix : prefixes) { - for (auto & postfixe : postfixes) + for (auto & postfix : postfixes) { try { - std::string name = elem + prefixe + t_module_name + postfixe; + std::string name = elem + prefix + t_module_name + postfix; // std::cerr << "trying location: " << name << std::endl; load_module(version_stripped_name, name); return name; diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index f6f83fe..06d53fa 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -1487,7 +1487,7 @@ namespace chaiscript } /** - * Reads an if/elseif/else block from input + * Reads an if/else if/else block from input */ bool If() { bool retval = false; diff --git a/include/chaiscript/language/chaiscript_prelude_docs.hpp b/include/chaiscript/language/chaiscript_prelude_docs.hpp index 5f9de26..e817420 100644 --- a/include/chaiscript/language/chaiscript_prelude_docs.hpp +++ b/include/chaiscript/language/chaiscript_prelude_docs.hpp @@ -5,7 +5,7 @@ namespace ChaiScript_Language { -/// \page LangStandardLibraryRef ChaiScript Language Standard Libary Reference +/// \page LangStandardLibraryRef ChaiScript Language Standard Library Reference /// /// ChaiScript, at its core, has some very functional programming-inspired habits. Few places show this off as clearly /// as the prelude, itself a name taken as a nod to the popular functional language Haskell. This prelude is available diff --git a/include/chaiscript/utility/utility.hpp b/include/chaiscript/utility/utility.hpp index c76c20d..bd60ef0 100644 --- a/include/chaiscript/utility/utility.hpp +++ b/include/chaiscript/utility/utility.hpp @@ -25,15 +25,15 @@ namespace chaiscript template void add_class(ModuleType &t_module, - const std::string &t_classname, + const std::string &t_class_name, const std::vector &t_constructors, const std::vector> &t_funcs) { - t_module.add(chaiscript::user_type(), t_classname); + t_module.add(chaiscript::user_type(), t_class_name); for(const chaiscript::Proxy_Function &ctor: t_constructors) { - t_module.add(ctor, t_classname); + t_module.add(ctor, t_class_name); } for(auto fun: t_funcs) diff --git a/samples/example.cpp b/samples/example.cpp index 9b51832..797a5ee 100644 --- a/samples/example.cpp +++ b/samples/example.cpp @@ -137,7 +137,7 @@ int main(int /*argc*/, char * /*argv*/[]) { //To do: Add examples of handling Boxed_Values directly when needed - //Creating a functor on the stack and using it immediatly + //Creating a functor on the stack and using it immediately int x = chai.eval >("fun (x, y) { return x + y; }")(5, 6); std::stringstream ss; diff --git a/samples/memory_leak_test.cpp b/samples/memory_leak_test.cpp index c1f899a..23a7455 100644 --- a/samples/memory_leak_test.cpp +++ b/samples/memory_leak_test.cpp @@ -24,7 +24,7 @@ std::string get_next_command() { #endif } -void fuction(void) +void function(void) { // do nothing } @@ -45,7 +45,7 @@ class test void ResetState() { chai.set_state(backupState); - chai.add(chaiscript::fun(&fuction),"Whatever()"); + chai.add(chaiscript::fun(&function),"Whatever()"); } void RunFile(std::string sFile) @@ -70,7 +70,7 @@ int main(int /*argc*/, char * /*argv*/[]) { std::string command = ""; // - // this loop increases memoryusage, if RunFile is not called (just hittin enter) + // this loop increases memoryusage, if RunFile is not called (just hitting enter) // as soon RunFile gets called, memory will be freed. // // scenario1 - RunFile gets called every Loop: memoryusage does not change diff --git a/unittests/c_linkage_test.cpp b/unittests/c_linkage_test.cpp index 833e400..28ec17a 100644 --- a/unittests/c_linkage_test.cpp +++ b/unittests/c_linkage_test.cpp @@ -3,7 +3,7 @@ extern "C" { - int dosomething(int i) + int do_something(int i) { return i % 2; } @@ -13,8 +13,8 @@ int main() { chaiscript::ChaiScript chai; - chai.add(chaiscript::fun(&dosomething), "dosomething"); + chai.add(chaiscript::fun(&do_something), "do_something"); - return chai.eval("dosomething(101)") == 101 % 2?EXIT_SUCCESS:EXIT_FAILURE; + return chai.eval("do_something(101)") == 101 % 2?EXIT_SUCCESS:EXIT_FAILURE; } diff --git a/unittests/expected_eval_errors_test.cpp b/unittests/expected_eval_errors_test.cpp index 698639a..c50e0ee 100644 --- a/unittests/expected_eval_errors_test.cpp +++ b/unittests/expected_eval_errors_test.cpp @@ -19,7 +19,7 @@ int main() // Dot notation try { - // non-existant function + // non-existent function chai.eval("\"test\".test_one()"); eval_error = false; } catch (const chaiscript::exception::eval_error &) { @@ -51,7 +51,7 @@ int main() // regular notation try { - // non-existant function + // non-existent function chai.eval("test_one(\"test\")"); eval_error = false; } catch (const chaiscript::exception::eval_error &) { diff --git a/unittests/multithreaded_test.cpp b/unittests/multithreaded_test.cpp index 26e4d55..0a6ac39 100644 --- a/unittests/multithreaded_test.cpp +++ b/unittests/multithreaded_test.cpp @@ -35,7 +35,7 @@ int main() { // Disable deprecation warning for getenv call. #ifdef CHAISCRIPT_MSVC -#ifdef max // Why microsoft? why? +#ifdef max // Why Microsoft? why? #undef max #endif #pragma warning(push) diff --git a/unittests/simultaneous_chaiscript_test.cpp b/unittests/simultaneous_chaiscript_test.cpp index 238f70a..4cdc267 100644 --- a/unittests/simultaneous_chaiscript_test.cpp +++ b/unittests/simultaneous_chaiscript_test.cpp @@ -1,11 +1,11 @@ #include -int dosomething(int i) +int do_something(int i) { return i + 2; } -int dosomethingelse(int i) +int do_something_else(int i) { return i * 2; } @@ -15,29 +15,29 @@ int dosomethingelse(int i) int main() { chaiscript::ChaiScript chai; - chai.add(chaiscript::fun(&dosomething), "dosomething"); + chai.add(chaiscript::fun(&do_something), "do_something"); chai.add(chaiscript::var(1), "i"); for (int i = 0; i < 10; ++i) { chaiscript::ChaiScript chai2; - chai2.add(chaiscript::fun(&dosomethingelse), "dosomethingelse"); + chai2.add(chaiscript::fun(&do_something_else), "do_something_else"); std::stringstream ss; ss << i; - if (chai.eval("dosomething(" + ss.str() + ")") != i + 2) + if (chai.eval("do_something(" + ss.str() + ")") != i + 2) { return EXIT_FAILURE; } - if (chai2.eval("dosomethingelse(" + ss.str() + ")") != i * 2) + if (chai2.eval("do_something_else(" + ss.str() + ")") != i * 2) { return EXIT_FAILURE; } try { - chai2.eval("dosomething(1)"); + chai2.eval("do_something(1)"); return EXIT_FAILURE; // should not get here } catch (const chaiscript::exception::eval_error &) { // nothing to do, expected case @@ -51,7 +51,7 @@ int main() } try { - chai.eval("dosomethingelse(1)"); + chai.eval("do_something_else(1)"); return EXIT_FAILURE; // should not get here } catch (const chaiscript::exception::eval_error &) { // nothing to do, expected case