Fix with function definitions of zero params
This commit is contained in:
parent
1bc71d21bd
commit
e6a0dc9af6
@ -411,10 +411,16 @@ namespace chaiscript
|
|||||||
for (i = 0; i < node->children[1]->children.size(); ++i) {
|
for (i = 0; i < node->children[1]->children.size(); ++i) {
|
||||||
param_names.push_back(node->children[1]->children[i]->text);
|
param_names.push_back(node->children[1]->children[i]->text);
|
||||||
}
|
}
|
||||||
|
ss.register_function(boost::shared_ptr<dispatchkit::Proxy_Function>(
|
||||||
|
new dispatchkit::Dynamic_Proxy_Function(boost::bind(&eval_function<Eval_System>, boost::ref(ss), node->children.back(), param_names, _1), node->children[1]->children.size())), node->children[0]->text);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//no parameters
|
||||||
|
ss.register_function(boost::shared_ptr<dispatchkit::Proxy_Function>(
|
||||||
|
//no parameters
|
||||||
|
new dispatchkit::Dynamic_Proxy_Function(boost::bind(&eval_function<Eval_System>, boost::ref(ss), node->children.back(), param_names, _1), 0)), node->children[0]->text);
|
||||||
|
|
||||||
ss.register_function(boost::shared_ptr<dispatchkit::Proxy_Function>(
|
}
|
||||||
new dispatchkit::Dynamic_Proxy_Function(boost::bind(&eval_function<Eval_System>, boost::ref(ss), node->children.back(), param_names, _1), node->children[1]->children.size())), node->children[0]->text);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Token_Type::Lambda) : {
|
case (Token_Type::Lambda) : {
|
||||||
|
@ -651,7 +651,8 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Char('(')) {
|
if (Char('(')) {
|
||||||
if (!(Arg_List() && Char(')'))) {
|
Arg_List();
|
||||||
|
if (!Char(')')) {
|
||||||
throw Parse_Error("Incomplete function definition", File_Position(line, col), filename);
|
throw Parse_Error("Incomplete function definition", File_Position(line, col), filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user