aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2017-08-09 05:58:06 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-12 00:28:48 +0800
commita8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c (patch)
tree785f44a497e3033e2163bd751f7660478a9f47bc /libsolidity/parsing/Parser.cpp
parent5b26e2bcee5f0cf3243fdcda53b47739f10158bb (diff)
downloaddexon-solidity-a8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c.tar.gz
dexon-solidity-a8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c.tar.zst
dexon-solidity-a8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c.zip
Enforce commas in tuple syntax
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index a6d6e025..066e3a29 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -1300,10 +1300,11 @@ ASTPointer<Expression> Parser::parsePrimaryExpression()
parserError("Expected expression (inline array elements cannot be omitted).");
else
components.push_back(ASTPointer<Expression>());
+
if (m_scanner->currentToken() == oppositeToken)
break;
- else if (m_scanner->currentToken() == Token::Comma)
- m_scanner->next();
+
+ expectToken(Token::Comma);
}
nodeFactory.markEndPosition();
expectToken(oppositeToken);