提升类型命名的完整度
This commit is contained in:
@@ -11,6 +11,20 @@ namespace Convention.RScript.Variable.CStyle
|
|||||||
{
|
{
|
||||||
public static string GetTypename(Type type)
|
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('`', '_');
|
var name = type.Name.Replace('`', '_');
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user