| 96 | } |
| 97 | |
| 98 | boost::any parseExpr(const char* text) |
| 99 | { |
| 100 | try { |
| 101 | const auto expression = parse(thisObj, text); |
| 102 | ExpressionPtr simplified = expression->simplify(); |
| 103 | return simplified->getValueAsAny(); |
| 104 | } |
| 105 | catch (const Base::ParserError& e) { |
| 106 | return e; |
| 107 | } |
| 108 | catch (const Expression::Exception& e) { |
| 109 | return e; |
| 110 | } |
| 111 | catch (const Base::ExpressionError& e) { |
| 112 | return e; |
| 113 | } |
| 114 | catch (const Base::RuntimeError& e) { |
| 115 | return e; |
| 116 | } |
| 117 | catch (const Base::Exception& e) { |
| 118 | // provide a much friendlier error message before failing |
| 119 | EXPECT_TRUE(false) << "Unexpected Base::Exception when parsing \"" << text |
| 120 | << "\": " << e.what(); |
| 121 | throw; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | private: |
| 126 | std::string docName; |
nothing calls this directly
no test coverage detected