A little cleanup of logical and/or since those are now separate evals.

This commit is contained in:
Jonathan Turner 2010-08-19 14:42:18 +00:00
parent 58c62f6333
commit c5f20ea158

View File

@ -276,7 +276,6 @@ namespace chaiscript
catch (const bad_boxed_cast &) { catch (const bad_boxed_cast &) {
throw Eval_Error("Condition not boolean"); throw Eval_Error("Condition not boolean");
} }
if (this->children[i]->text == "&&") {
if (lhs) { if (lhs) {
try { try {
retval = this->children[i+1]->eval(ss); retval = this->children[i+1]->eval(ss);
@ -290,21 +289,6 @@ namespace chaiscript
retval = Boxed_Value(false); retval = Boxed_Value(false);
} }
} }
else if (this->children[i]->text == "||") {
if (lhs) {
retval = Boxed_Value(true);
}
else {
try {
retval = this->children[i+1]->eval(ss);
}
catch (Eval_Error &ee) {
ee.call_stack.push_back(this->children[i+1]);
throw;
}
}
}
}
} }
return retval; return retval;
} }
@ -330,21 +314,6 @@ namespace chaiscript
catch (const bad_boxed_cast &) { catch (const bad_boxed_cast &) {
throw Eval_Error("Condition not boolean"); throw Eval_Error("Condition not boolean");
} }
if (this->children[i]->text == "&&") {
if (lhs) {
try {
retval = this->children[i+1]->eval(ss);
}
catch (Eval_Error &ee) {
ee.call_stack.push_back(this->children[i+1]);
throw;
}
}
else {
retval = Boxed_Value(false);
}
}
else if (this->children[i]->text == "||") {
if (lhs) { if (lhs) {
retval = Boxed_Value(true); retval = Boxed_Value(true);
} }
@ -359,7 +328,6 @@ namespace chaiscript
} }
} }
} }
}
return retval; return retval;
} }