aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/Parser.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-13 20:31:24 +0800
committerchriseth <c@ethdev.com>2015-10-13 20:31:24 +0800
commit72f7792f8e09b41987ddd493984402891d49238f (patch)
treebaed9ab43931470a8c60b73e6593de605223ee32 /libsolidity/Parser.cpp
parent13d7bc4ee8effe78dd496064065717af2cbeacc0 (diff)
downloaddexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar.gz
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar.bz2
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar.lz
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar.xz
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.tar.zst
dexon-solidity-72f7792f8e09b41987ddd493984402891d49238f.zip
Some further test fixes.
Diffstat (limited to 'libsolidity/Parser.cpp')
-rw-r--r--libsolidity/Parser.cpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp
index 98e1fbf8..88a6b030 100644
--- a/libsolidity/Parser.cpp
+++ b/libsolidity/Parser.cpp
@@ -785,29 +785,30 @@ ASTPointer<VariableDeclarationStatement> Parser::parseVariableDeclarationStateme
// Parse `var (a, b, ,, c) = ...` into a single VariableDeclarationStatement with multiple variables.
m_scanner->next();
m_scanner->next();
- while (true)
- {
- ASTPointer<VariableDeclaration> var;
- if (
- m_scanner->currentToken() != Token::Comma &&
- m_scanner->currentToken() != Token::RParen
- )
+ if (m_scanner->currentToken() != Token::RParen)
+ while (true)
{
- ASTNodeFactory varDeclNodeFactory(*this);
- ASTPointer<ASTString> name = expectIdentifierToken();
- var = varDeclNodeFactory.createNode<VariableDeclaration>(
- ASTPointer<TypeName>(),
- name,
- ASTPointer<Expression>(),
- VariableDeclaration::Visibility::Default
- );
+ ASTPointer<VariableDeclaration> var;
+ if (
+ m_scanner->currentToken() != Token::Comma &&
+ m_scanner->currentToken() != Token::RParen
+ )
+ {
+ ASTNodeFactory varDeclNodeFactory(*this);
+ ASTPointer<ASTString> name = expectIdentifierToken();
+ var = varDeclNodeFactory.createNode<VariableDeclaration>(
+ ASTPointer<TypeName>(),
+ name,
+ ASTPointer<Expression>(),
+ VariableDeclaration::Visibility::Default
+ );
+ }
+ variables.push_back(var);
+ if (m_scanner->currentToken() == Token::RParen)
+ break;
+ else
+ expectToken(Token::Comma);
}
- variables.push_back(var);
- if (m_scanner->currentToken() == Token::RParen)
- break;
- else
- expectToken(Token::Comma);
- }
nodeFactory.markEndPosition();
m_scanner->next();
}