Implements basics for UserData

This commit is contained in:
2019-06-14 14:59:38 +02:00
parent 831dbe6917
commit 996b5be496
14 changed files with 232 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
#include "Binder.hpp"
#include "../TableScriptType.hpp"
#include "BoundExpressions/BoundTableExpression.hpp"
#include "../UserData/UserDataScriptType.hpp"
#include <memory>
BoundScriptStatement *Binder::Bind(Script* script, const ParsedScriptStatement *s, BoundScope* scriptScope) {
@@ -74,7 +75,7 @@ std::shared_ptr<ScriptType> ParseTypeIdentifier(HashedString s){
case HashedString::ConstHash("number"): return std::make_shared<NumericScriptType>(false, false);
case HashedString::ConstHash("bool"): return std::make_shared<ScriptType>(TypeClass::Bool);
case HashedString::ConstHash("string"): return std::make_shared<StringScriptType>(false, 0);
default: return std::make_shared<ScriptType>(TypeClass::Error); // todo: change to userdata
default: return std::make_shared<UserDataScriptType>(s.GetHash());
}
}