Fix tests broken by last cleanup
This commit is contained in:
parent
e286b9a9aa
commit
e64e4b0877
@ -471,6 +471,7 @@ namespace chaiscript
|
||||
|
||||
virtual ~Equation_AST_Node() {}
|
||||
virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE {
|
||||
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
||||
Boxed_Value rhs = this->children[2]->eval(t_ss);
|
||||
Boxed_Value lhs = this->children[0]->eval(t_ss);
|
||||
|
||||
@ -488,7 +489,6 @@ namespace chaiscript
|
||||
}
|
||||
|
||||
try {
|
||||
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
||||
|
||||
if (lhs.is_undef()) {
|
||||
if (!this->children.empty() &&
|
||||
@ -529,7 +529,6 @@ namespace chaiscript
|
||||
}
|
||||
else {
|
||||
try {
|
||||
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
||||
return t_ss.call_function(this->children[1]->text, std::move(lhs), rhs);
|
||||
} catch(const exception::dispatch_error &e){
|
||||
throw exception::eval_error("Unable to find appropriate'" + this->children[1]->text + "' operator.", e.parameters, e.functions, false, t_ss);
|
||||
|
@ -296,7 +296,7 @@ namespace chaiscript
|
||||
void build_match(size_t t_match_start, std::string t_text = "") {
|
||||
bool is_deep = false;
|
||||
|
||||
Parse_Location filepos = [&](){
|
||||
Parse_Location filepos = [&]()->Parse_Location{
|
||||
//so we want to take everything to the right of this and make them children
|
||||
if (t_match_start != m_match_stack.size()) {
|
||||
is_deep = true;
|
||||
@ -318,17 +318,15 @@ namespace chaiscript
|
||||
}
|
||||
}();
|
||||
|
||||
std::vector<AST_NodePtr> new_children =
|
||||
[&](){
|
||||
if (is_deep) {
|
||||
std::vector<AST_NodePtr> c(std::make_move_iterator(m_match_stack.begin() + static_cast<int>(t_match_start)),
|
||||
std::make_move_iterator(m_match_stack.end()));
|
||||
m_match_stack.erase(m_match_stack.begin() + static_cast<int>(t_match_start), m_match_stack.end());
|
||||
return c;
|
||||
} else {
|
||||
return std::vector<AST_NodePtr>();
|
||||
}
|
||||
}();
|
||||
std::vector<AST_NodePtr> new_children;
|
||||
|
||||
if (is_deep) {
|
||||
new_children.assign(std::make_move_iterator(m_match_stack.begin() + static_cast<int>(t_match_start)),
|
||||
std::make_move_iterator(m_match_stack.end()));
|
||||
// new_children = std::vector<AST_NodePtr>(std::make_move_iterator(m_match_stack.begin() + static_cast<int>(t_match_start)),
|
||||
// std::make_move_iterator(m_match_stack.end()));
|
||||
m_match_stack.erase(m_match_stack.begin() + static_cast<int>(t_match_start), m_match_stack.end());
|
||||
}
|
||||
|
||||
/// \todo fix the fact that a successful match that captured no ast_nodes doesn't have any real start position
|
||||
m_match_stack.push_back(
|
||||
@ -738,7 +736,7 @@ namespace chaiscript
|
||||
++pos;
|
||||
}
|
||||
|
||||
Boxed_Value i = [&](){
|
||||
Boxed_Value i = [&]()->Boxed_Value{
|
||||
if (match.length() <= sizeof(int) * 8)
|
||||
{
|
||||
return const_var(static_cast<int>(temp_int));
|
||||
|
Loading…
x
Reference in New Issue
Block a user