Implements basic numerical tables
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-09 20:15:09 +02:00
parent ec2419bc7d
commit 081def0be0
21 changed files with 324 additions and 24 deletions

View File

@@ -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