Move parser-specific stuff into its own class
This commit is contained in:
@@ -650,7 +650,8 @@ namespace chaiscript {
|
|||||||
retval = true;
|
retval = true;
|
||||||
|
|
||||||
if (Char('(')) {
|
if (Char('(')) {
|
||||||
if (!(Arg_List() && Char(')'))) {
|
Arg_List();
|
||||||
|
if (!Char(')')) {
|
||||||
throw Parse_Error("Incomplete anonymous function", File_Position(line, col), filename);
|
throw Parse_Error("Incomplete anonymous function", File_Position(line, col), filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,11 +15,11 @@ if(Boost_FOUND)
|
|||||||
add_executable(chaiscript_test main.cpp)
|
add_executable(chaiscript_test main.cpp)
|
||||||
target_link_libraries(chaiscript_test ${Boost_LIBRARIES})
|
target_link_libraries(chaiscript_test ${Boost_LIBRARIES})
|
||||||
|
|
||||||
add_executable(chaiscript_callbacktest callbacktest.cpp)
|
#add_executable(chaiscript_callbacktest callbacktest.cpp)
|
||||||
target_link_libraries(chaiscript_callbacktest ${Boost_LIBRARIES})
|
#target_link_libraries(chaiscript_callbacktest ${Boost_LIBRARIES})
|
||||||
|
|
||||||
add_executable(sensors sensors.cpp)
|
#add_executable(sensors sensors.cpp)
|
||||||
target_link_libraries(sensors ${Boost_LIBRARIES})
|
#target_link_libraries(sensors ${Boost_LIBRARIES})
|
||||||
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -424,12 +424,17 @@ namespace chaiscript
|
|||||||
for (i = 0; i < node->children[0]->children.size(); ++i) {
|
for (i = 0; i < node->children[0]->children.size(); ++i) {
|
||||||
param_names.push_back(node->children[0]->children[i]->text);
|
param_names.push_back(node->children[0]->children[i]->text);
|
||||||
}
|
}
|
||||||
|
//retval = boost::shared_ptr<dispatchkit::Proxy_Function>(new dispatchkit::Proxy_Function_Impl<boost::function<void (const std::string &)> >(&test));
|
||||||
|
retval = dispatchkit::Boxed_Value(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[0]->children.size())));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//no parameters
|
||||||
|
retval = dispatchkit::Boxed_Value(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), 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//retval = boost::shared_ptr<dispatchkit::Proxy_Function>(new dispatchkit::Proxy_Function_Impl<boost::function<void (const std::string &)> >(&test));
|
|
||||||
retval = dispatchkit::Boxed_Value(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[0]->children.size())));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
1167
chaiscript/chaiscript_parser.hpp
Normal file
1167
chaiscript/chaiscript_parser.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user