diff options
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index ec6d11f4..b0cf364e 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -1350,13 +1350,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); |