Merge pull request #2316 from ethereum/inlineasm-cleanup

Better error message for elementary operations
This commit is contained in:
chriseth 2017-05-26 11:29:51 +02:00 committed by GitHub
commit 68e1e464be

View File

@ -102,9 +102,6 @@ assembly::Statement Parser::parseStatement()
expectToken(Token::Identifier); expectToken(Token::Identifier);
return assignment; return assignment;
} }
case Token::Return: // opcode
case Token::Byte: // opcode
case Token::Address: // opcode
default: default:
break; break;
} }
@ -287,7 +284,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
fatalParserError( fatalParserError(
m_julia ? m_julia ?
"Literal or identifier expected." : "Literal or identifier expected." :
"Expected elementary inline assembly operation." "Literal, identifier or instruction expected."
); );
} }
return ret; return ret;
@ -299,7 +296,7 @@ assembly::VariableDeclaration Parser::parseVariableDeclaration()
expectToken(Token::Let); expectToken(Token::Let);
while (true) while (true)
{ {
varDecl.variables.push_back(parseTypedName()); varDecl.variables.emplace_back(parseTypedName());
if (m_scanner->currentToken() == Token::Comma) if (m_scanner->currentToken() == Token::Comma)
expectToken(Token::Comma); expectToken(Token::Comma);
else else