C++: Include primitive types in reserved name list

This commit is contained in:
Katy Coe
2020-10-07 05:49:06 +02:00
parent 0c983fcebd
commit 9746a6f4a8
2 changed files with 14 additions and 12 deletions

View File

@@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Il2CppInspector.Cpp
{
@@ -31,6 +30,14 @@ namespace Il2CppInspector.Cpp
renameCount[name] = 0;
}
// Try to mark a name as reserved without assigning an object to it (e.g. for keywords and built-in names)
public bool TryReserveName(string name) {
if (renameCount.ContainsKey(name))
return false;
renameCount[name] = 0;
return true;
}
// Create a Namer object which will give names to objects of type T which are unique within this namespace
public Namer<T> MakeNamer<T>(Namer<T>.KeyFunc keyFunc) {
return new Namer<T>(this, keyFunc);