public static string FormatRawValue(Type t, object o) { if (o == null) { return("nil"); } switch (t.Namespace) { case "System": switch (t.Name) { case "String": return($"@\"{o}\""); case "Single": float f = (float)o; if (Single.IsNaN(f)) { return("NAN"); } if (Single.IsInfinity(f)) { return("INFINITY"); } return(o + "f"); case "Double": double d = (double)o; if (Double.IsNaN(d)) { return("NAN"); } if (Double.IsInfinity(d)) { return("INFINITY"); } return(o + "d"); case "UInt32": return(o + "ul"); case "Int64": return(o + "ll"); case "UInt64": return(o + "ull"); } break; } if (t.IsEnum) { return(NameGenerator.GetTypeName(t) + t.GetEnumName(o)); } return(o.ToString()); }