2023-06-08 18:14:35 +00:00
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
2023-03-09 23:57:16 +00:00
|
|
|
namespace tlang
|
|
|
|
{
|
2023-06-08 18:14:35 +00:00
|
|
|
public class TChar : TObject
|
2023-03-09 23:57:16 +00:00
|
|
|
{
|
2023-06-08 18:14:35 +00:00
|
|
|
public override JToken AsToken()
|
|
|
|
{
|
|
|
|
return JValue.FromObject(Value);
|
|
|
|
}
|
|
|
|
public static implicit operator char(TChar c)
|
|
|
|
{
|
|
|
|
return c.Value;
|
|
|
|
}
|
2023-03-09 23:57:16 +00:00
|
|
|
public override bool AsBoolean => Value != '\0';
|
|
|
|
public char Value {get;set;}
|
|
|
|
public TChar(char v)
|
|
|
|
{
|
|
|
|
Value = v;
|
|
|
|
}
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return Value.ToString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|