[muparser] ParserBase::Eval to return an error instead of throwing

This commit is contained in:
ridiculousfish 2017-12-17 14:31:39 -08:00
parent 11d729d09c
commit 2f2f4b4287

View file

@ -1470,7 +1470,10 @@ void ParserBase::StackDump(const ParserStack<token_type> &a_stVal,
*/ */
void ParserBase::Eval(std::vector<ValueOrError> *outResult) const { void ParserBase::Eval(std::vector<ValueOrError> *outResult) const {
ValueOrError v = (this->*m_pParseFormula)(); ValueOrError v = (this->*m_pParseFormula)();
if (v.has_error()) throw v.error(); if (v.has_error()) {
outResult->push_back(std::move(v));
return;
}
int stackSize = m_nFinalResultIdx; int stackSize = m_nFinalResultIdx;
// (for historic reasons the stack starts at position 1) // (for historic reasons the stack starts at position 1)