aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-12 01:50:35 +0800
committerGitHub <noreply@github.com>2017-08-12 01:50:35 +0800
commitd968912a4ce89a40d7d03bf0748a07c397662f68 (patch)
tree785f44a497e3033e2163bd751f7660478a9f47bc /libsolidity
parent5b26e2bcee5f0cf3243fdcda53b47739f10158bb (diff)
parenta8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c (diff)
downloaddexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar.gz
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar.bz2
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar.lz
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar.xz
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.tar.zst
dexon-solidity-d968912a4ce89a40d7d03bf0748a07c397662f68.zip
Merge pull request #2714 from federicobond/enforce-tuple-commas
Enforce commas in tuple/array syntax
Diffstat (limited to 'libsolidity')
-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);