Commit 7e30d0dc authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #17176. Apply clang-format patch.

parent 5b7c08b9
......@@ -50,12 +50,11 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL Expression {
public:
/// Specialised exception for parsing errors
class ParsingError: public std::runtime_error {
class ParsingError : public std::runtime_error {
public:
ParsingError(const std::string& msg, const std::string& expr, size_t i);
ParsingError(const std::string& msg);
ParsingError(const std::string &msg, const std::string &expr, size_t i);
ParsingError(const std::string &msg);
};
/// Default contructor
......
......@@ -266,7 +266,8 @@ void Expression::tokenize() {
m_expr.resize(last);
break;
} else {
throw ParsingError("A binary operator isn't followed by a value", m_expr, i);
throw ParsingError("A binary operator isn't followed by a value",
m_expr, i);
}
}
......
......@@ -47,7 +47,7 @@ FunctionFactoryImpl::createInitialized(const std::string &input) const {
Expression expr;
try {
expr.parse(input);
} catch (Expression::ParsingError& e) {
} catch (Expression::ParsingError &e) {
inputError(input + "\n " + e.what());
} catch (...) {
inputError(input);
......
......@@ -460,7 +460,8 @@ public:
e.parse("x+y+z)");
TS_FAIL("Expected an exception.");
} catch (Expression::ParsingError &e) {
TS_ASSERT_EQUALS(std::string(e.what()), "Unmatched bracket at\n\nx+y+z)\n^\n");
TS_ASSERT_EQUALS(std::string(e.what()),
"Unmatched bracket at\n\nx+y+z)\n^\n");
}
}
......@@ -470,7 +471,9 @@ public:
e.parse("x+y+");
TS_FAIL("Expected an exception.");
} catch (Expression::ParsingError &e) {
TS_ASSERT_EQUALS(std::string(e.what()), "A binary operator isn't followed by a value at\n\nx+y+\n ^\n");
TS_ASSERT_EQUALS(
std::string(e.what()),
"A binary operator isn't followed by a value at\n\nx+y+\n ^\n");
}
}
......@@ -480,7 +483,8 @@ public:
e.parse("x+y++++z");
TS_FAIL("Expected an exception.");
} catch (Expression::ParsingError &e) {
TS_ASSERT_EQUALS(std::string(e.what()), "Unrecognized operator at\n\nx+y++++z\n ^\n");
TS_ASSERT_EQUALS(std::string(e.what()),
"Unrecognized operator at\n\nx+y++++z\n ^\n");
}
}
......@@ -490,7 +494,9 @@ public:
e.parse("x+y+ + + +");
TS_FAIL("Expected an exception.");
} catch (Expression::ParsingError &e) {
TS_ASSERT_EQUALS(std::string(e.what()), "A binary operator isn't followed by a value at\n\nx+y+ + + +\n ^\n");
TS_ASSERT_EQUALS(std::string(e.what()), "A binary operator isn't "
"followed by a value at\n\nx+y+ "
"+ + +\n ^\n");
}
}
......@@ -500,10 +506,10 @@ public:
e.parse("x+y+ )");
TS_FAIL("Expected an exception.");
} catch (Expression::ParsingError &e) {
TS_ASSERT_EQUALS(std::string(e.what()), "Unmatched bracket at\n\nx+y+ )\n^\n");
TS_ASSERT_EQUALS(std::string(e.what()),
"Unmatched bracket at\n\nx+y+ )\n^\n");
}
}
};
#endif /*EXPRESSIONTEST_H_*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment