mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improve error reporting of trailing commas
This commit is contained in:
parent
54e97d1c34
commit
60bfae75e5
@ -1335,13 +1335,19 @@ pair<vector<ASTPointer<Expression>>, vector<ASTPointer<ASTString>>> Parser::pars
|
||||
if (!first)
|
||||
expectToken(Token::Comma);
|
||||
|
||||
if (m_scanner->currentToken() == Token::RBrace)
|
||||
fatalParserError("Unexpected trailing comma.");
|
||||
|
||||
ret.second.push_back(expectIdentifierToken());
|
||||
expectToken(Token::Colon);
|
||||
ret.first.push_back(parseExpression());
|
||||
|
||||
if (
|
||||
m_scanner->currentToken() == Token::Comma &&
|
||||
m_scanner->peekNextToken() == Token::RBrace
|
||||
)
|
||||
{
|
||||
parserError("Unexpected trailing comma.");
|
||||
m_scanner->next();
|
||||
}
|
||||
|
||||
first = false;
|
||||
}
|
||||
expectToken(Token::RBrace);
|
||||
|
Loading…
Reference in New Issue
Block a user