mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Inline array declarations complete
This commit is contained in:
+20
-2
@@ -1126,9 +1126,10 @@ private:
|
||||
ASTPointer<Expression> m_rightHandSide;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Tuple or just parenthesized expression.
|
||||
* Examples: (1, 2), (x,), (x), ()
|
||||
* Tuple, parenthesized expression, or bracketed expression.
|
||||
* Examples: (1, 2), (x,), (x), (), [1, 2],
|
||||
* Individual components might be empty shared pointers (as in the second example).
|
||||
* The respective types in lvalue context are: 2-tuple, 2-tuple (with wildcard), type of x, 0-tuple
|
||||
* Not in lvalue context: 2-tuple, _1_-tuple, type of x, 0-tuple.
|
||||
@@ -1150,6 +1151,23 @@ private:
|
||||
std::vector<ASTPointer<Expression>> m_components;
|
||||
};
|
||||
|
||||
class InlineArrayExpression: public Expression
|
||||
{
|
||||
public:
|
||||
InlineArrayExpression(
|
||||
SourceLocation const& _location,
|
||||
std::vector<ASTPointer<Expression>> const& _components
|
||||
):
|
||||
Expression(_location), m_components(_components) {}
|
||||
virtual void accept(ASTVisitor& _visitor) override;
|
||||
virtual void accept(ASTConstVisitor& _visitor) const override;
|
||||
|
||||
std::vector<ASTPointer<Expression>> const& components() const { return m_components; }
|
||||
|
||||
private:
|
||||
std::vector<ASTPointer<Expression>> m_components;
|
||||
};
|
||||
|
||||
/**
|
||||
* Operation involving a unary operator, pre- or postfix.
|
||||
* Examples: ++i, delete x or !true
|
||||
|
||||
Reference in New Issue
Block a user