Extreme error reporting capabilities update and bug fixes

This commit is contained in:
Jason Turner
2012-06-25 06:31:34 -06:00
parent 5a76d98692
commit a8ea5f151d
5 changed files with 373 additions and 50 deletions

View File

@@ -25,7 +25,6 @@ namespace chaiscript
typedef boost::shared_ptr<struct AST_Node> AST_NodePtr;
namespace dispatch
{
/**
@@ -591,14 +590,16 @@ namespace chaiscript
class dispatch_error : public std::runtime_error
{
public:
dispatch_error(const std::vector<Boxed_Value> &t_bvs)
: std::runtime_error("Error with function dispatch"), parameters(t_bvs)
dispatch_error(const std::vector<Boxed_Value> &t_parameters,
const std::vector<Const_Proxy_Function> &t_functions)
: std::runtime_error("Error with function dispatch"), parameters(t_parameters), functions(t_functions)
{
}
virtual ~dispatch_error() throw() {}
std::vector<Boxed_Value> parameters;
std::vector<Const_Proxy_Function> functions;
};
}
@@ -611,9 +612,10 @@ namespace chaiscript
* function is found or throw dispatch_error if no matching function is found
*/
template<typename InItr>
Boxed_Value dispatch(InItr begin, InItr end,
Boxed_Value dispatch(InItr begin, const InItr &end,
const std::vector<Boxed_Value> &plist)
{
InItr orig(begin);
while (begin != end)
{
try {
@@ -632,7 +634,7 @@ namespace chaiscript
++begin;
}
throw exception::dispatch_error(plist);
throw exception::dispatch_error(plist, std::vector<Const_Proxy_Function>(orig, end));
}
/**