No longer allow a local variable to be used as a function during dot notation sugar lookup. It's far less confusing this way
This commit is contained in:
parent
d8213a4206
commit
faaa964565
@ -509,25 +509,18 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//std::string fun_name;
|
std::string fun_name;
|
||||||
Boxed_Value fn;
|
std::vector<std::pair<std::string, Proxy_Function > > funs;
|
||||||
try {
|
if (node->children[i]->identifier == Token_Type::Fun_Call) {
|
||||||
if (node->children[i]->identifier == Token_Type::Fun_Call) {
|
fun_name = node->children[i]->children[0]->text;
|
||||||
//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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Eval_Error &ee) {
|
else {
|
||||||
ss.set_stack(prev_stack);
|
fun_name = node->children[i]->text;
|
||||||
throw Eval_Error(ee.reason, node->children[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ss.set_stack(new_stack);
|
ss.set_stack(new_stack);
|
||||||
retval = (*boxed_cast<Const_Proxy_Function >(fn))(plb);
|
retval = ss.call_function(fun_name, plb);
|
||||||
ss.set_stack(prev_stack);
|
ss.set_stack(prev_stack);
|
||||||
}
|
}
|
||||||
catch(const dispatch_error &e){
|
catch(const dispatch_error &e){
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
var addit = fun(x, y) { return x+y }
|
|
||||||
|
|
||||||
print(3.addit(4))
|
|
@ -1 +0,0 @@
|
|||||||
7
|
|
Loading…
x
Reference in New Issue
Block a user