Implements indexing with period identifier style (`foo.bar`)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -24,6 +24,7 @@ enum class BoundExpressionKind{
|
||||
Binary,
|
||||
FunctionCall,
|
||||
Index,
|
||||
PeriodIndex,
|
||||
NumericalTable,
|
||||
Table,
|
||||
};
|
||||
@@ -279,6 +280,31 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BoundPeriodIndexExpression : public BoundExpression {
|
||||
BoundExpression* _indexableExpression;
|
||||
HashedString _index;
|
||||
public:
|
||||
BoundPeriodIndexExpression(BoundExpression* indexableExpression, HashedString index, shared_ptr<ScriptType> result,
|
||||
unsigned int start, unsigned int length)
|
||||
: BoundExpression(start, length, std::move(result)), _indexableExpression(indexableExpression), _index(index) {}
|
||||
|
||||
~BoundPeriodIndexExpression() final{
|
||||
delete _indexableExpression;
|
||||
}
|
||||
|
||||
const BoundExpressionKind GetKind() const final{
|
||||
return BoundExpressionKind ::PeriodIndex;
|
||||
}
|
||||
|
||||
const BoundExpression* GetIndexableExpression() const{
|
||||
return _indexableExpression;
|
||||
}
|
||||
|
||||
const HashedString GetIndex() const{
|
||||
return _index;
|
||||
}
|
||||
};
|
||||
|
||||
class BoundNumericalTableExpression : public BoundExpression{
|
||||
const vector<BoundExpression*> _expressions;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user