mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduced tuple type and added multi variable declarations to type
checker.
This commit is contained in:
+22
-2
@@ -783,14 +783,34 @@ ASTPointer<VariableDeclarationStatement> Parser::parseVariableDeclarationStateme
|
||||
)
|
||||
{
|
||||
// Parse `var (a, b, ,, c) = ...` into a single VariableDeclarationStatement with multiple variables.
|
||||
solAssert(false, "To be implemented.");
|
||||
m_scanner->next();
|
||||
m_scanner->next();
|
||||
do
|
||||
{
|
||||
ASTPointer<VariableDeclaration> var;
|
||||
if (m_scanner->currentToken() == Token::Comma)
|
||||
m_scanner->next();
|
||||
else
|
||||
{
|
||||
ASTNodeFactory varDeclNodeFactory(*this);
|
||||
ASTPointer<ASTString> name = expectIdentifierToken();
|
||||
var = varDeclNodeFactory.createNode<VariableDeclaration>(
|
||||
ASTPointer<TypeName>(),
|
||||
name,
|
||||
ASTPointer<Expression>(),
|
||||
VariableDeclaration::Visibility::Default
|
||||
);
|
||||
}
|
||||
variables.push_back(var);
|
||||
} while (m_scanner->currentToken() != Token::RParen);
|
||||
nodeFactory.markEndPosition();
|
||||
m_scanner->next();
|
||||
}
|
||||
else
|
||||
{
|
||||
VarDeclParserOptions options;
|
||||
options.allowVar = true;
|
||||
options.allowLocationSpecifier = true;
|
||||
options.allowInitialValue = false;
|
||||
variables.push_back(parseVariableDeclaration(options, _lookAheadArrayType));
|
||||
}
|
||||
if (m_scanner->currentToken() == Token::Assign)
|
||||
|
||||
Reference in New Issue
Block a user