Skip to content

Commit

Permalink
Uniform error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed May 24, 2017
1 parent 130f741 commit 338202e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions libsolidity/inlineasm/AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,11 @@ assembly::Statement Parser::parseCall(assembly::Statement&& _instruction)
/// check for premature closing parentheses
if (m_scanner->currentToken() == Token::RParen)
fatalParserError(string(
"Expected " +
"Expected expression (" +
instrInfo.name +
" expects " +
boost::lexical_cast<string>(args) +
" arguments, but received " +
boost::lexical_cast<string>(i)
" arguments)"
));

ret.arguments.emplace_back(parseExpression());
Expand Down
2 changes: 1 addition & 1 deletion test/libsolidity/InlineAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(invalid_tuple_assignment)

BOOST_AUTO_TEST_CASE(instruction_too_few_arguments)
{
CHECK_PARSE_ERROR("{ mul() }", ParserError, "Expected 2 arguments, but received 0");
CHECK_PARSE_ERROR("{ mul() }", ParserError, "Expected expression (MUL expects 2 arguments)");
CHECK_PARSE_ERROR("{ mul(1) }", ParserError, "Expected comma (MUL expects 2 arguments)");
}

Expand Down

0 comments on commit 338202e

Please sign in to comment.