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:
@@ -1,15 +1,10 @@
|
||||
#include <utility>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
||||
#ifndef PORYGONLANG_BOUNDEXPRESSION_HPP
|
||||
#define PORYGONLANG_BOUNDEXPRESSION_HPP
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include "../../ScriptType.hpp"
|
||||
#include "../BoundOperators.hpp"
|
||||
#include "../BoundVariables/BoundVariableKey.hpp"
|
||||
@@ -29,6 +24,7 @@ enum class BoundExpressionKind{
|
||||
Binary,
|
||||
FunctionCall,
|
||||
Index,
|
||||
NumericalTable,
|
||||
};
|
||||
|
||||
class BoundExpression{
|
||||
@@ -276,5 +272,28 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BoundNumericalTableExpression : public BoundExpression{
|
||||
vector<BoundExpression*> _expressions;
|
||||
public:
|
||||
BoundNumericalTableExpression(vector<BoundExpression*> expressions, shared_ptr<ScriptType> type, unsigned int start, unsigned int length)
|
||||
: BoundExpression(start, length, type){
|
||||
_expressions = std::move(expressions);
|
||||
}
|
||||
|
||||
~BoundNumericalTableExpression(){
|
||||
for (auto e: _expressions){
|
||||
delete e;
|
||||
}
|
||||
}
|
||||
|
||||
BoundExpressionKind GetKind() final{
|
||||
return BoundExpressionKind ::NumericalTable;
|
||||
}
|
||||
|
||||
vector<BoundExpression*> GetExpressions(){
|
||||
return _expressions;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif //PORYGONLANG_BOUNDEXPRESSION_HPP
|
||||
|
||||
Reference in New Issue
Block a user