Move parser-specific stuff into its own class
This commit is contained in:
@@ -650,7 +650,8 @@ namespace chaiscript {
|
||||
retval = true;
|
||||
|
||||
if (Char('(')) {
|
||||
if (!(Arg_List() && Char(')'))) {
|
||||
Arg_List();
|
||||
if (!Char(')')) {
|
||||
throw Parse_Error("Incomplete anonymous function", File_Position(line, col), filename);
|
||||
}
|
||||
}
|
||||
|
@@ -15,11 +15,11 @@ if(Boost_FOUND)
|
||||
add_executable(chaiscript_test main.cpp)
|
||||
target_link_libraries(chaiscript_test ${Boost_LIBRARIES})
|
||||
|
||||
add_executable(chaiscript_callbacktest callbacktest.cpp)
|
||||
target_link_libraries(chaiscript_callbacktest ${Boost_LIBRARIES})
|
||||
#add_executable(chaiscript_callbacktest callbacktest.cpp)
|
||||
#target_link_libraries(chaiscript_callbacktest ${Boost_LIBRARIES})
|
||||
|
||||
add_executable(sensors sensors.cpp)
|
||||
target_link_libraries(sensors ${Boost_LIBRARIES})
|
||||
#add_executable(sensors sensors.cpp)
|
||||
#target_link_libraries(sensors ${Boost_LIBRARIES})
|
||||
|
||||
|
||||
endif()
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -424,13 +424,18 @@ namespace chaiscript
|
||||
for (i = 0; i < node->children[0]->children.size(); ++i) {
|
||||
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)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case (Token_Type::Block) : {
|
||||
|
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