mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
now is compiling and passing soltest...but I think there may be a few more things to do
This commit is contained in:
parent
5a462afd03
commit
aebce8a1d5
@ -1150,10 +1150,12 @@ public:
|
||||
virtual void accept(ASTConstVisitor& _visitor) const override;
|
||||
|
||||
std::vector<ASTPointer<Expression>> const& components() const { return m_components; }
|
||||
bool isInlineArray() const { return m_isArray; }
|
||||
|
||||
private:
|
||||
std::vector<ASTPointer<Expression>> m_components;
|
||||
bool isInlineArray() const { return m_isArray; }
|
||||
bool m_isArray;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1037,11 +1037,13 @@ ASTPointer<Expression> Parser::parsePrimaryExpression()
|
||||
case Token::LParen:
|
||||
case Token::LBrack:
|
||||
{
|
||||
// Tuple or parenthesized expression.
|
||||
// Special cases: () is empty tuple type, (x) is not a real tuple, (x,) is one-dimensional tuple
|
||||
// Tuple/parenthesized expression or inline array/bracketed expression.
|
||||
// Special cases: ()/[] is empty tuple/array type, (x)/[] is not a real tuple/array,
|
||||
// (x,) is one-dimensional tuple
|
||||
m_scanner->next();
|
||||
vector<ASTPointer<Expression>> components;
|
||||
Token::Value oppositeToken = (token == LParen ? Token::RParen : Token::RBrack);
|
||||
Token::Value oppositeToken = (token == Token::LParen ? Token::RParen : Token::RBrack);
|
||||
bool isArray = (token == Token::LParen ? false : true);
|
||||
|
||||
if (m_scanner->currentToken() != Token::RParen)
|
||||
while (true)
|
||||
@ -1057,7 +1059,7 @@ ASTPointer<Expression> Parser::parsePrimaryExpression()
|
||||
}
|
||||
nodeFactory.markEndPosition();
|
||||
expectToken(oppositeToken);
|
||||
return nodeFactory.createNode<TupleExpression>(components);
|
||||
return nodeFactory.createNode<TupleExpression>(components, isArray);
|
||||
}
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user