aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
authorwadeAlexC <wade.alex.c@gmail.com>2017-09-22 05:42:34 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-25 17:42:01 +0800
commit0099911ace631789ab8a2294710b9fd57af1c478 (patch)
tree43863cdf1d56406ef3135689b27c109e7f590152 /libsolidity/parsing/Parser.cpp
parentccb689701e6a602a44bf2941ca71c683f96907d1 (diff)
downloaddexon-solidity-0099911ace631789ab8a2294710b9fd57af1c478.tar.gz
dexon-solidity-0099911ace631789ab8a2294710b9fd57af1c478.tar.zst
dexon-solidity-0099911ace631789ab8a2294710b9fd57af1c478.zip
Better error message for unexpected trailing comma in parameter lists
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index ce8a9f01..9a8bb358 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -828,6 +828,8 @@ ASTPointer<ParameterList> Parser::parseParameterList(
parameters.push_back(parseVariableDeclaration(options));
while (m_scanner->currentToken() != Token::RParen)
{
+ if (m_scanner->currentToken() == Token::Comma && m_scanner->peekNextToken() == Token::RParen)
+ fatalParserError("Unexpected trailing comma in parameter list.");
expectToken(Token::Comma);
parameters.push_back(parseVariableDeclaration(options));
}