diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index c0cda5c..c9446a5 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -509,25 +509,18 @@ namespace chaiscript } } - //std::string fun_name; - Boxed_Value fn; - try { - if (node->children[i]->identifier == Token_Type::Fun_Call) { - //fun_name = node->children[i]->children[0]->text; - fn = eval_token(ss, node->children[i]->children[0]); - } - else { - //fun_name = node->children[i]->text; - fn = eval_token(ss, node->children[i]); - } + std::string fun_name; + std::vector > funs; + if (node->children[i]->identifier == Token_Type::Fun_Call) { + fun_name = node->children[i]->children[0]->text; } - catch(Eval_Error &ee) { - ss.set_stack(prev_stack); - throw Eval_Error(ee.reason, node->children[i]); + else { + fun_name = node->children[i]->text; } + try { ss.set_stack(new_stack); - retval = (*boxed_cast(fn))(plb); + retval = ss.call_function(fun_name, plb); ss.set_stack(prev_stack); } catch(const dispatch_error &e){ diff --git a/unittests/method_lambda.chai b/unittests/method_lambda.chai deleted file mode 100644 index bf7805e..0000000 --- a/unittests/method_lambda.chai +++ /dev/null @@ -1,3 +0,0 @@ -var addit = fun(x, y) { return x+y } - -print(3.addit(4)) diff --git a/unittests/method_lambda.txt b/unittests/method_lambda.txt deleted file mode 100644 index 7f8f011..0000000 --- a/unittests/method_lambda.txt +++ /dev/null @@ -1 +0,0 @@ -7