Skip to content

Commit

Permalink
Better Val.ToString() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pachanga committed Mar 17, 2022
1 parent f5e6fb3 commit e234cc1
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,17 @@ public bool IsValueEqual(Val o)
public override string ToString()
{
string str = "";
if(type == Types.Int)
str = _num + ":<INT>";
else if(type == Types.Float)
str = _num + ":<FLOAT>";
else if(type == Types.Bool)
str = bval + ":<BOOL>";
else if(type == Types.String)
str = this.str + ":<STRING>";
else if(type == Types.Any)
str = _obj?.GetType().Name + ":<OBJ>";
else if(type == null)
str = "<NONE>";
if(type != null)
str += "(" + type.GetName() + ")";
else
str = "Val: type:"+type;
str += "(?)";
str += " num:" + _num;
str += " num2:" + _num2;
str += " num3:" + _num3;
str += " num4:" + _num4;
str += " obj.type:" + _obj?.GetType().Name;
str += " obj:" + _obj;
str += " (refs:" + _refs + ")";

return str;// + " " + GetHashCode();//for extra debug
}
Expand Down

0 comments on commit e234cc1

Please sign in to comment.