diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-12 00:23:13 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 06:16:14 +0800 |
commit | 931e96838a433b3634ae7ab3347f7650cd78003d (patch) | |
tree | fd0202c885dc1435e04d4b010f88dc756a91c897 | |
parent | c3a9ae0b0657861c8cc27f60358b0bfe99ed05ae (diff) | |
download | dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar.gz dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar.bz2 dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar.lz dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar.xz dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.tar.zst dexon-solidity-931e96838a433b3634ae7ab3347f7650cd78003d.zip |
Disallow trailing comma in Enum Declaration
-rw-r--r-- | Parser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -282,12 +282,15 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition() vector<ASTPointer<EnumDeclaration>> members; expectToken(Token::LBrace); - while (m_scanner->getCurrentToken() == Token::Identifier) + while (m_scanner->getCurrentToken() != Token::RBrace) { members.push_back(parseEnumDeclaration()); if (m_scanner->getCurrentToken() == Token::RBrace) break; expectToken(Token::Comma); + if (m_scanner->getCurrentToken() != Token::Identifier) { + BOOST_THROW_EXCEPTION(createParserError("Expected Identifier after ,")); + } } nodeFactory.markEndPosition(); |