提升类型命名的完整度

This commit is contained in:
2025-11-25 11:58:31 +08:00
parent 29dd4f5d96
commit 5b235a7f26

View File

@@ -11,6 +11,20 @@ namespace Convention.RScript.Variable.CStyle
{
public static string GetTypename(Type type)
{
if (type == typeof(int))
return "int";
if (type == typeof(float))
return "float";
if (type == typeof(double))
return "double";
if (type == typeof(bool))
return "bool";
if (type == typeof(void))
return "void";
if (type.IsEnum)
return type.FullName.Replace('`', '_');
if (type.IsClass)
return type.FullName.Replace('`', '_');
var name = type.Name.Replace('`', '_');
return name;
}