diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 07ea45db..0071d61a 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -229,7 +229,7 @@ namespace chaiscript std::advance(itr, pos); container.erase(itr); } - + } template @@ -547,13 +547,13 @@ namespace chaiscript m->add(fun(find_func( [](const String *s, const String &f, size_t pos) { return s->find_last_not_of(f, pos); } ) ), "find_last_not_of"); m->add(fun(find_func( [](const String *s, const String &f, size_t pos) { return s->find_first_not_of(f, pos); } ) ), "find_first_not_of"); - m->add(fun( std::function( [](String *s) { return s->clear(); } ) ), "clear"); - m->add(fun( std::function( [](const String *s) { return s->empty(); } ) ), "empty"); - m->add(fun( std::function( [](const String *s) { return s->size(); } ) ), "size"); + m->add(fun( std::function( [](String *s) { return s->clear(); } ) ), "clear"); + m->add(fun( std::function( [](const String *s) { return s->empty(); } ) ), "empty"); + m->add(fun( std::function( [](const String *s) { return s->size(); } ) ), "size"); m->add(fun( std::function( [](const String *s) { return s->c_str(); } ) ), "c_str"); m->add(fun( std::function( [](const String *s) { return s->data(); } ) ), "data"); - m->add(fun( std::function( [](const String *s, size_t pos, size_t len) { return s->substr(pos, len); } ) ), "substr"); + m->add(fun( std::function( [](const String *s, size_t pos, size_t len) { return s->substr(pos, len); } ) ), "substr"); return m; } diff --git a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp index 4b0be5b9..39a6948a 100644 --- a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp +++ b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp @@ -52,10 +52,10 @@ namespace chaiscript } }; - template - struct Cast_Helper_Inner : Cast_Helper_Inner - { - }; + template + struct Cast_Helper_Inner : Cast_Helper_Inner + { + }; /** * Cast_Helper_Inner for casting to a const & type @@ -221,9 +221,9 @@ namespace chaiscript struct Cast_Helper_Inner : Cast_Helper_Inner { }; - - /** + + /** * Cast_Helper_Inner for casting to a std::reference_wrapper type */ template @@ -263,7 +263,7 @@ namespace chaiscript struct Cast_Helper { typedef typename Cast_Helper_Inner::Result_Type Result_Type; - + static Result_Type cast(const Boxed_Value &ob, const Dynamic_Cast_Conversions *t_conversions) { return Cast_Helper_Inner::cast(ob, t_conversions); diff --git a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp index 139b3726..1660a273 100644 --- a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp @@ -114,7 +114,7 @@ namespace chaiscript { } }; - + /** * Used by Proxy_Function_Impl to determine if it is equivalent to another @@ -155,7 +155,7 @@ namespace chaiscript #endif template static Ret do_call(const std::function &f, - const std::vector &, const Dynamic_Cast_Conversions &t_conversions, InnerParams &&... innerparams) + const std::vector &, const Dynamic_Cast_Conversions &t_conversions, InnerParams &&... innerparams) { return f(boxed_cast(std::forward(innerparams), &t_conversions)...); } @@ -181,7 +181,7 @@ namespace chaiscript throw exception::arity_error(static_cast(params.size()), sizeof...(Params)); } - + } } diff --git a/include/chaiscript/language/chaiscript_algebraic.hpp b/include/chaiscript/language/chaiscript_algebraic.hpp index 71bfbfee..b5d1b315 100644 --- a/include/chaiscript/language/chaiscript_algebraic.hpp +++ b/include/chaiscript/language/chaiscript_algebraic.hpp @@ -5,7 +5,7 @@ // http://www.chaiscript.com #ifndef CHAISCRIPT_ALGEBRAIC_HPP_ -#define CHAISCRIPT_ALGEBRAIC_HPP_ +#define CHAISCRIPT_ALGEBRAIC_HPP_ #include @@ -128,5 +128,5 @@ namespace chaiscript }; } -#endif /* _CHAISCRIPT_ALGEBRAIC_HPP */ +#endif /* _CHAISCRIPT_ALGEBRAIC_HPP */ diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index a7fad247..aef4e81a 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -584,5 +584,5 @@ namespace chaiscript } } -#endif /* _CHAISCRIPT_COMMON_HPP */ +#endif /* _CHAISCRIPT_COMMON_HPP */ diff --git a/samples/for.chai b/samples/for.chai index 87c94b3b..96a2945f 100644 --- a/samples/for.chai +++ b/samples/for.chai @@ -1,13 +1,13 @@ for (var i = 0; i < 10; ++i) { - print(i) + print(i) } for (var i = 10; i >= 0; i -= 2) { - print(i) + print(i) } var i = 0 for (; i < 5; ++i) { - print(i) + print(i) } diff --git a/samples/fun.chai b/samples/fun.chai index d1420907..3d00b6b7 100644 --- a/samples/fun.chai +++ b/samples/fun.chai @@ -1,10 +1,10 @@ //functions of zero params don't need them: def meet { - print("Hello") + print("Hello") } def greet(x) { - print("Hello, " + x.to_string()) + print("Hello, " + x.to_string()) } //but you need parens for invocation: diff --git a/samples/if.chai b/samples/if.chai index ceff089c..f7ddd953 100644 --- a/samples/if.chai +++ b/samples/if.chai @@ -1,10 +1,10 @@ var i = 0 if (i == 0) { - print("i is 0") + print("i is 0") } else if (i == 1) { - print("i is 1") + print("i is 1") } else { - print("i is not 0 or 1") + print("i is not 0 or 1") } diff --git a/samples/loop_break.chai b/samples/loop_break.chai index c65a8a66..afb150e2 100644 --- a/samples/loop_break.chai +++ b/samples/loop_break.chai @@ -1,20 +1,20 @@ for (var i = 0; i < 10; ++i) { - print("i: " + i.to_string()) - if (i == 5) { - break - } + print("i: " + i.to_string()) + if (i == 5) { + break + } } var j = 0 while (true) { - while (true) { - ++j; - if (j == 5) { - break - } - } - break + while (true) { + ++j; + if (j == 5) { + break + } + } + break } print("j: " + j.to_string()) diff --git a/samples/memory_leak_test.cpp b/samples/memory_leak_test.cpp index 7129da21..c1f899a9 100644 --- a/samples/memory_leak_test.cpp +++ b/samples/memory_leak_test.cpp @@ -35,28 +35,28 @@ class test chaiscript::ChaiScript::State backupState; public: - test() - : chai(chaiscript::Std_Lib::library()) - { - backupState = chai.get_state(); - } - ~test(){} + test() + : chai(chaiscript::Std_Lib::library()) + { + backupState = chai.get_state(); + } + ~test(){} - void ResetState() - { - chai.set_state(backupState); - chai.add(chaiscript::fun(&fuction),"Whatever()"); - } + void ResetState() + { + chai.set_state(backupState); + chai.add(chaiscript::fun(&fuction),"Whatever()"); + } - void RunFile(std::string sFile) - { - try { - chaiscript::Boxed_Value val = chai.eval_file(sFile); - } - catch (std::exception &e) { - std::cout << e.what() << std::endl; - } + void RunFile(std::string sFile) + { + try { + chaiscript::Boxed_Value val = chai.eval_file(sFile); } + catch (std::exception &e) { + std::cout << e.what() << std::endl; + } + } }; diff --git a/samples/oper.chai b/samples/oper.chai index 77161a62..61697ff8 100644 --- a/samples/oper.chai +++ b/samples/oper.chai @@ -2,7 +2,7 @@ var x = -(1 + 2 - 3 * 4 / 2) print("Answer: " + x.to_string()) if (x >= 2 && x <= 4) { - print("x is between 2 and 4") + print("x is between 2 and 4") } diff --git a/samples/scope.chai b/samples/scope.chai index b5bfdbf6..23b47541 100644 --- a/samples/scope.chai +++ b/samples/scope.chai @@ -6,10 +6,10 @@ */ var x = 4 def do_it() { - var x = 1 - print(x) - var y = fun(x) { x + 1 } - print(y(9)) + var x = 1 + print(x) + var y = fun(x) { x + 1 } + print(y(9)) } do_it() print(x) diff --git a/samples/vector.chai b/samples/vector.chai index c3d98bc8..4e087d6f 100644 --- a/samples/vector.chai +++ b/samples/vector.chai @@ -11,6 +11,6 @@ var size = vec.size() print("Vector Size: " + size.to_string()); while (i < size) { - print(i.to_string() + ": " + to_string(vec[i])) - i = i + 1 + print(i.to_string() + ": " + to_string(vec[i])) + i = i + 1 } diff --git a/samples/while.chai b/samples/while.chai index 74d4234e..2c6a26e8 100644 --- a/samples/while.chai +++ b/samples/while.chai @@ -1,5 +1,5 @@ var i = 0 while (i < 10) { - print("i: " + i.to_string()) - i = i + 1 + print("i: " + i.to_string()) + i = i + 1 } diff --git a/unittests/3.x/break_while.chai b/unittests/3.x/break_while.chai index d54a3dd9..5ff897c8 100644 --- a/unittests/3.x/break_while.chai +++ b/unittests/3.x/break_while.chai @@ -1,7 +1,7 @@ var i = 0 while (i < 10) { - if (++i == 5) { - break - } + if (++i == 5) { + break + } } assert_equal(5, i); diff --git a/unittests/3.x/mmd1.chai b/unittests/3.x/mmd1.chai index ff38a3c5..36121a90 100644 --- a/unittests/3.x/mmd1.chai +++ b/unittests/3.x/mmd1.chai @@ -1,17 +1,17 @@ def bob(x, y, z) { - x + y + z + x + y + z } def bob(x, y) { - x - y + x - y } def bob(x) { - -x + -x } def bob() { - 10 + 10 } assert_equal(10, bob()) diff --git a/unittests/3.x/return.chai b/unittests/3.x/return.chai index 512f52fc..1747de90 100644 --- a/unittests/3.x/return.chai +++ b/unittests/3.x/return.chai @@ -1,5 +1,5 @@ def sam() { - return 5 + return 5 } assert_equal(5, sam()) diff --git a/unittests/3.x/use.inc b/unittests/3.x/use.inc index 204cec40..28970935 100644 --- a/unittests/3.x/use.inc +++ b/unittests/3.x/use.inc @@ -1,4 +1,4 @@ def greet { - return("hello") + return("hello") } diff --git a/unittests/boxed_cast_test.cpp b/unittests/boxed_cast_test.cpp index c3c8931d..c398b7b1 100644 --- a/unittests/boxed_cast_test.cpp +++ b/unittests/boxed_cast_test.cpp @@ -44,9 +44,9 @@ bool test_type_conversion(const Boxed_Value &bv, bool expectedpass) if (!ret) { std::cerr << "Error with type conversion test. From: " - << (bv.is_const()?(std::string("const ")):(std::string())) << bv.get_type_info().name() - << " To: " - << (std::is_const::value?(std::string("const ")):(std::string())) << typeid(To).name() + << (bv.is_const()?(std::string("const ")):(std::string())) << bv.get_type_info().name() + << " To: " + << (std::is_const::value?(std::string("const ")):(std::string())) << typeid(To).name() << " test was expected to " << ((expectedpass)?(std::string("succeed")):(std::string("fail"))) << " but did not" << std::endl; } diff --git a/unittests/break_while.chai b/unittests/break_while.chai index bfede2ce..fd1c6ad9 100644 --- a/unittests/break_while.chai +++ b/unittests/break_while.chai @@ -1,7 +1,7 @@ auto i = 0 while (i < 10) { - if (++i == 5) { - break - } + if (++i == 5) { + break + } } assert_equal(5, i); diff --git a/unittests/mmd1.chai b/unittests/mmd1.chai index ff38a3c5..36121a90 100644 --- a/unittests/mmd1.chai +++ b/unittests/mmd1.chai @@ -1,17 +1,17 @@ def bob(x, y, z) { - x + y + z + x + y + z } def bob(x, y) { - x - y + x - y } def bob(x) { - -x + -x } def bob() { - 10 + 10 } assert_equal(10, bob()) diff --git a/unittests/return.chai b/unittests/return.chai index 512f52fc..1747de90 100644 --- a/unittests/return.chai +++ b/unittests/return.chai @@ -1,5 +1,5 @@ def sam() { - return 5 + return 5 } assert_equal(5, sam()) diff --git a/unittests/use.inc b/unittests/use.inc index 204cec40..28970935 100644 --- a/unittests/use.inc +++ b/unittests/use.inc @@ -1,4 +1,4 @@ def greet { - return("hello") + return("hello") }