Enabled void->list conversion in parse-time

This commit is contained in:
Leonetienne
2021-06-03 01:11:40 +02:00
parent e16bda06a4
commit ce90ff689b
2 changed files with 88 additions and 11 deletions

View File

@@ -161,6 +161,11 @@ Value* Hazelnupp::ParseValue(const std::vector<std::string>& values, const Param
// Void-type
if (values.size() == 0)
{
// Is a list forced via a constraint? If yes, return an empty list
if ((constrainType) &&
(constraint->wantedType == DATA_TYPE::LIST))
return new ListValue();
return new VoidValue;
}