|
|
|
@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Diagnostics; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Reflection; |
|
|
|
|
using System.Reflection.Metadata; |
|
|
|
@ -473,6 +474,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -473,6 +474,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
reservedVariableNames.Add(proposedName, 0); |
|
|
|
|
} |
|
|
|
|
int count = ++reservedVariableNames[proposedName]; |
|
|
|
|
Debug.Assert(!string.IsNullOrWhiteSpace(proposedName)); |
|
|
|
|
if (count > 1) |
|
|
|
|
{ |
|
|
|
|
return proposedName + count.ToString(); |
|
|
|
@ -763,6 +765,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -763,6 +765,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
reservedVariableNames.Add(proposedName, 0); |
|
|
|
|
} |
|
|
|
|
int count = ++reservedVariableNames[proposedName]; |
|
|
|
|
Debug.Assert(!string.IsNullOrWhiteSpace(proposedName)); |
|
|
|
|
if (count > 1) |
|
|
|
|
{ |
|
|
|
|
return proposedName + count.ToString(); |
|
|
|
@ -815,6 +818,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -815,6 +818,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
reservedVariableNames.Add(proposedName, 0); |
|
|
|
|
} |
|
|
|
|
int count = ++reservedVariableNames[proposedName]; |
|
|
|
|
Debug.Assert(!string.IsNullOrWhiteSpace(proposedName)); |
|
|
|
|
if (count > 1) |
|
|
|
|
{ |
|
|
|
|
return proposedName + count.ToString(); |
|
|
|
@ -828,7 +832,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -828,7 +832,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
private static bool IsPlural(string baseName, ref string proposedName) |
|
|
|
|
{ |
|
|
|
|
var newName = Vocabularies.Default.Singularize(baseName, inputIsKnownToBePlural: false); |
|
|
|
|
if (newName == baseName) |
|
|
|
|
if (string.IsNullOrWhiteSpace(newName) || newName == baseName) |
|
|
|
|
return false; |
|
|
|
|
proposedName = newName; |
|
|
|
|
return true; |
|
|
|
|