mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Have more uniform parser errors
This commit is contained in:
parent
c7ee649d80
commit
cc10839073
@ -276,7 +276,7 @@ assembly::Expression Parser::parseExpression()
|
|||||||
int args = instructionInfo(instr.instruction).args;
|
int args = instructionInfo(instr.instruction).args;
|
||||||
if (args > 0 && currentToken() != Token::LParen)
|
if (args > 0 && currentToken() != Token::LParen)
|
||||||
fatalParserError(string(
|
fatalParserError(string(
|
||||||
"Expected token \"(\" (\"" +
|
"Expected '(' (instruction \"" +
|
||||||
instructionNames().at(instr.instruction) +
|
instructionNames().at(instr.instruction) +
|
||||||
"\" expects " +
|
"\" expects " +
|
||||||
boost::lexical_cast<string>(args) +
|
boost::lexical_cast<string>(args) +
|
||||||
@ -504,7 +504,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
|||||||
/// check for premature closing parentheses
|
/// check for premature closing parentheses
|
||||||
if (currentToken() == Token::RParen)
|
if (currentToken() == Token::RParen)
|
||||||
fatalParserError(string(
|
fatalParserError(string(
|
||||||
"Expected expression (\"" +
|
"Expected expression (instruction \"" +
|
||||||
instructionNames().at(instr) +
|
instructionNames().at(instr) +
|
||||||
"\" expects " +
|
"\" expects " +
|
||||||
boost::lexical_cast<string>(args) +
|
boost::lexical_cast<string>(args) +
|
||||||
@ -516,7 +516,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
|||||||
{
|
{
|
||||||
if (currentToken() != Token::Comma)
|
if (currentToken() != Token::Comma)
|
||||||
fatalParserError(string(
|
fatalParserError(string(
|
||||||
"Expected comma (\"" +
|
"Expected ',' (instruction \"" +
|
||||||
instructionNames().at(instr) +
|
instructionNames().at(instr) +
|
||||||
"\" expects " +
|
"\" expects " +
|
||||||
boost::lexical_cast<string>(args) +
|
boost::lexical_cast<string>(args) +
|
||||||
@ -529,7 +529,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
|||||||
ret.location.end = endPosition();
|
ret.location.end = endPosition();
|
||||||
if (currentToken() == Token::Comma)
|
if (currentToken() == Token::Comma)
|
||||||
fatalParserError(string(
|
fatalParserError(string(
|
||||||
"Expected ')' (\"" +
|
"Expected ')' (instruction \"" +
|
||||||
instructionNames().at(instr) +
|
instructionNames().at(instr) +
|
||||||
"\" expects " +
|
"\" expects " +
|
||||||
boost::lexical_cast<string>(args) +
|
boost::lexical_cast<string>(args) +
|
||||||
|
@ -528,7 +528,7 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition()
|
|||||||
break;
|
break;
|
||||||
expectToken(Token::Comma);
|
expectToken(Token::Comma);
|
||||||
if (m_scanner->currentToken() != Token::Identifier)
|
if (m_scanner->currentToken() != Token::Identifier)
|
||||||
fatalParserError(string("Expected Identifier after ','"));
|
fatalParserError(string("Expected identifier after ','"));
|
||||||
}
|
}
|
||||||
if (members.size() == 0)
|
if (members.size() == 0)
|
||||||
parserError({"enum with no members is not allowed."});
|
parserError({"enum with no members is not allowed."});
|
||||||
|
Loading…
Reference in New Issue
Block a user