aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser.cpp b/Parser.cpp
index a26713a7..e59e698f 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -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();