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:
@@ -25,6 +25,7 @@ enum class ParsedExpressionKind{
|
||||
Parenthesized,
|
||||
FunctionCall,
|
||||
Indexer,
|
||||
PeriodIndexer,
|
||||
NumericalTable,
|
||||
Table,
|
||||
};
|
||||
@@ -287,6 +288,34 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class PeriodIndexExpression : public ParsedExpression{
|
||||
const ParsedExpression* _indexerExpression;
|
||||
const HashedString _index;
|
||||
public:
|
||||
PeriodIndexExpression(ParsedExpression* indexer, HashedString index, unsigned int start, unsigned int length)
|
||||
:ParsedExpression(start, length),
|
||||
_indexerExpression(indexer), _index(index)
|
||||
{
|
||||
}
|
||||
|
||||
~PeriodIndexExpression() final{
|
||||
delete _indexerExpression;
|
||||
}
|
||||
|
||||
const ParsedExpressionKind GetKind() const final{
|
||||
return ParsedExpressionKind::PeriodIndexer;
|
||||
}
|
||||
|
||||
const ParsedExpression* GetIndexer() const{
|
||||
return _indexerExpression;
|
||||
}
|
||||
|
||||
const HashedString& GetIndex() const{
|
||||
return _index;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ParsedNumericalTableExpression : public ParsedExpression{
|
||||
vector<const ParsedExpression*> _expressions;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user