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

This commit is contained in:
2019-06-12 15:19:28 +02:00
parent ba4fe888fa
commit c022c91777
21 changed files with 272 additions and 50 deletions

View File

@@ -25,6 +25,7 @@ enum class BoundExpressionKind{
FunctionCall,
Index,
NumericalTable,
Table,
};
class BoundExpression{
@@ -102,7 +103,7 @@ class BoundLiteralStringExpression : public BoundExpression{
string _value;
public:
BoundLiteralStringExpression(string value, unsigned int start, unsigned int length)
: BoundExpression(start, length, make_shared<ScriptType>(TypeClass::String)){
: BoundExpression(start, length, make_shared<StringScriptType>(true, HashedString::ConstHash(value.c_str()))){
_value = std::move(value);
}
@@ -276,11 +277,11 @@ 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){
: BoundExpression(start, length, std::move(type)){
_expressions = std::move(expressions);
}
~BoundNumericalTableExpression(){
~BoundNumericalTableExpression() final{
for (auto e: _expressions){
delete e;
}