Generic For Loops

This commit is contained in:
2018-11-23 18:18:07 +01:00
parent 2db4d0607e
commit 638394d25b
38 changed files with 530 additions and 327 deletions

View File

@@ -3,7 +3,7 @@ using Upsilon.Text;
namespace Upsilon.BaseTypes.UserData
{
internal class GenericUserData : LuaType, IUserData
internal class GenericUserData : ScriptType, IUserData
{
public GenericUserData(object dictionary)
{
@@ -25,7 +25,7 @@ namespace Upsilon.BaseTypes.UserData
return Value.GetType();
}
public virtual LuaType Get(Diagnostics diagnostics, TextSpan span, LuaType index, EvaluationScope scope)
public virtual ScriptType Get(Diagnostics diagnostics, TextSpan span, ScriptType index, EvaluationScope scope)
{
var s = index.ToCSharpObject().ToString();
var (type, failed, error) = _typeInfo.Get(Value, s);
@@ -36,7 +36,7 @@ namespace Upsilon.BaseTypes.UserData
return type;
}
public virtual void Set(Diagnostics diagnostics, TextSpan span, LuaType index, LuaType value)
public virtual void Set(Diagnostics diagnostics, TextSpan span, ScriptType index, ScriptType value)
{
var s = index.ToCSharpObject().ToString();
var (failed, error) = _typeInfo.Set(Value, s, value);
@@ -46,12 +46,12 @@ namespace Upsilon.BaseTypes.UserData
}
}
public (LuaType Type, bool Failed) BinaryOperator(LuaType par1, OperatorType op, LuaType par2)
public (ScriptType Type, bool Failed) BinaryOperator(ScriptType par1, OperatorType op, ScriptType par2)
{
return _typeInfo.BinaryOperator(Value, par1, op, par2);
}
public (LuaType Type, bool Failed) UnaryOperator(LuaType par1, OperatorType op)
public (ScriptType Type, bool Failed) UnaryOperator(ScriptType par1, OperatorType op)
{
return _typeInfo.UnaryOperator(Value, par1, op);
}