@@ -27,8 +27,10 @@ public class StructGenerator
27
27
private StringBuilder methodInfoHeader = new StringBuilder ( ) ;
28
28
private static HashSet < ulong > methodInfoCache = new HashSet < ulong > ( ) ;
29
29
private static HashSet < string > keyword = new HashSet < string > ( StringComparer . Ordinal )
30
- { "klass" , "monitor" , "register" , "_cs" , "auto" , "friend" , "template" , "near" , "far" , "flat" , "default" , "_ds" , "interrupt" , "inline" ,
31
- "unsigned" , "signed" , "asm" , "if" , "case" , "break" , "continue" , "do" , "new" , "_" , "short" , "union" } ;
30
+ { "klass" , "monitor" , "register" , "_cs" , "auto" , "friend" , "template" , "flat" , "default" , "_ds" , "interrupt" ,
31
+ "unsigned" , "signed" , "asm" , "if" , "case" , "break" , "continue" , "do" , "new" , "_" , "short" , "union" , "class" } ;
32
+ private static HashSet < string > specialKeywords = new HashSet < string > ( StringComparer . Ordinal )
33
+ { "inline" , "near" , "far" } ;
32
34
33
35
public StructGenerator ( Il2CppExecutor il2CppExecutor )
34
36
{
@@ -494,6 +496,11 @@ private static string FixName(string str)
494
496
{
495
497
str = "_" + str ;
496
498
}
499
+ else if ( specialKeywords . Contains ( str ) )
500
+ {
501
+ str = "_" + str + "_" ;
502
+ }
503
+
497
504
if ( Regex . IsMatch ( str , "^[0-9]" ) )
498
505
{
499
506
return "_" + str ;
0 commit comments