Implements basics for UserData
This commit is contained in:
@@ -102,6 +102,7 @@ shared_ptr<EvalValue> Evaluator::EvaluateExpression(const BoundExpression *expre
|
||||
case TypeClass ::Function: return this->EvaluateFunctionExpression(expression);
|
||||
case TypeClass ::Nil: return this->EvaluateNilExpression(expression);
|
||||
case TypeClass ::Table: return this-> EvaluateTableExpression(expression);
|
||||
case TypeClass ::UserData: return this -> EvaluateUserDataExpression(expression);
|
||||
default: throw;
|
||||
}
|
||||
}
|
||||
@@ -291,3 +292,11 @@ shared_ptr<EvalValue> Evaluator::EvaluateComplexTableExpression(const BoundExpre
|
||||
this -> _evaluationScope = currentEvaluator;
|
||||
return make_shared<TableEvalValue>(variables);
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> Evaluator::EvaluateUserDataExpression(const BoundExpression *expression) {
|
||||
switch (expression->GetKind()){
|
||||
case BoundExpressionKind ::Variable: return this->GetVariable((BoundVariableExpression*)expression);
|
||||
case BoundExpressionKind ::Index: return this -> EvaluateIndexExpression(expression);
|
||||
default: throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user