Implements basic numerical tables
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:
@@ -23,6 +23,7 @@ enum class ParsedExpressionKind{
|
||||
Parenthesized,
|
||||
FunctionCall,
|
||||
Indexer,
|
||||
NumericalTable,
|
||||
};
|
||||
|
||||
class ParsedExpression {
|
||||
@@ -270,5 +271,28 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class ParsedNumericalTableExpression : public ParsedExpression{
|
||||
vector<ParsedExpression*> _expressions;
|
||||
public:
|
||||
ParsedNumericalTableExpression(vector<ParsedExpression*> expressions, unsigned int start, unsigned int length)
|
||||
: ParsedExpression(start, length){
|
||||
_expressions = std::move(expressions);
|
||||
}
|
||||
|
||||
~ParsedNumericalTableExpression() final{
|
||||
for (auto s: _expressions){
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
vector<ParsedExpression*> GetExpressions(){
|
||||
return _expressions;
|
||||
}
|
||||
|
||||
ParsedExpressionKind GetKind() final{
|
||||
return ParsedExpressionKind::NumericalTable;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif //PORYGONLANG_PARSEDEXPRESSION_HPP
|
||||
|
||||
Reference in New Issue
Block a user