mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Initial introduction of array slices with partial implementation for dynamic calldata arrays.
This commit is contained in:
@@ -1642,6 +1642,32 @@ private:
|
||||
ASTPointer<Expression> m_index;
|
||||
};
|
||||
|
||||
/**
|
||||
* Index range access to an array. Example: a[2:3]
|
||||
*/
|
||||
class IndexRangeAccess: public Expression
|
||||
{
|
||||
public:
|
||||
IndexRangeAccess(
|
||||
SourceLocation const& _location,
|
||||
ASTPointer<Expression> const& _base,
|
||||
ASTPointer<Expression> const& _start,
|
||||
ASTPointer<Expression> const& _end
|
||||
):
|
||||
Expression(_location), m_base(_base), m_start(_start), m_end(_end) {}
|
||||
void accept(ASTVisitor& _visitor) override;
|
||||
void accept(ASTConstVisitor& _visitor) const override;
|
||||
|
||||
Expression const& baseExpression() const { return *m_base; }
|
||||
Expression const* startExpression() const { return m_start.get(); }
|
||||
Expression const* endExpression() const { return m_end.get(); }
|
||||
|
||||
private:
|
||||
ASTPointer<Expression> m_base;
|
||||
ASTPointer<Expression> m_start;
|
||||
ASTPointer<Expression> m_end;
|
||||
};
|
||||
|
||||
/**
|
||||
* Primary expression, i.e. an expression that cannot be divided any further. Examples are literals
|
||||
* or variable references.
|
||||
|
||||
Reference in New Issue
Block a user