Separate userdata collection handling

This commit is contained in:
Deukhoofd 2019-09-28 12:03:50 +02:00
parent 326a3c097a
commit e7e5e64bbb
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
4 changed files with 4 additions and 1 deletions

View File

@ -75,6 +75,7 @@ namespace Porygon{
case TypeClass::String: return "string";
case TypeClass::Function: return "function";
case TypeClass::UserData: return "userdata";
case TypeClass::UserDataCollection: return "userdata-collection";
case TypeClass::Table: return "table";
case TypeClass::Any: return "all";
}

View File

@ -18,6 +18,7 @@ namespace Porygon{
String,
Function,
UserData,
UserDataCollection,
Table,
Any,
};

View File

@ -107,6 +107,7 @@ namespace Porygon::StandardLibraries{
case TypeClass::String: return new Evaluation::StringEvalValue(u"string");
case TypeClass::Function: return new Evaluation::StringEvalValue(u"function");
case TypeClass::UserData: return new Evaluation::StringEvalValue(u"userdata");
case TypeClass::UserDataCollection: return new Evaluation::StringEvalValue(u"userdata-collection");
case TypeClass::Table: return new Evaluation::StringEvalValue(u"table");
case TypeClass::Any: return new Evaluation::StringEvalValue(u"all");
}

View File

@ -60,7 +60,7 @@ namespace Porygon::UserData {
[[nodiscard]] TypeClass GetTypeClass() const final{
return TypeClass ::Table;
return TypeClass ::UserDataCollection;
}
bool operator==(const EvalValue *b) const final{