mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow trailing comma in Enum Declaration
This commit is contained in:
parent
c3a9ae0b06
commit
931e96838a
@ -282,12 +282,15 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition()
|
|||||||
vector<ASTPointer<EnumDeclaration>> members;
|
vector<ASTPointer<EnumDeclaration>> members;
|
||||||
expectToken(Token::LBrace);
|
expectToken(Token::LBrace);
|
||||||
|
|
||||||
while (m_scanner->getCurrentToken() == Token::Identifier)
|
while (m_scanner->getCurrentToken() != Token::RBrace)
|
||||||
{
|
{
|
||||||
members.push_back(parseEnumDeclaration());
|
members.push_back(parseEnumDeclaration());
|
||||||
if (m_scanner->getCurrentToken() == Token::RBrace)
|
if (m_scanner->getCurrentToken() == Token::RBrace)
|
||||||
break;
|
break;
|
||||||
expectToken(Token::Comma);
|
expectToken(Token::Comma);
|
||||||
|
if (m_scanner->getCurrentToken() != Token::Identifier) {
|
||||||
|
BOOST_THROW_EXCEPTION(createParserError("Expected Identifier after ,"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeFactory.markEndPosition();
|
nodeFactory.markEndPosition();
|
||||||
|
Loading…
Reference in New Issue
Block a user