mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
LabelName: dont replace [] with nothing, cause we need it for be unique name
This commit is contained in:
parent
f53e37f6b4
commit
f0e99d7653
1 changed files with 3 additions and 1 deletions
|
|
@ -34,7 +34,8 @@ namespace Cosmos.Assembler {
|
||||||
public static string Get(string aMethodLabel, int aIlPos) {
|
public static string Get(string aMethodLabel, int aIlPos) {
|
||||||
return aMethodLabel + ".IL_" + aIlPos.ToString("X4");
|
return aMethodLabel + ".IL_" + aIlPos.ToString("X4");
|
||||||
}
|
}
|
||||||
public static System.Text.RegularExpressions.Regex IllegalCharsReplace = new System.Text.RegularExpressions.Regex(@"[&.,+$<>{}\-\`\\'/\\ \(\)\[\]\*!=]", System.Text.RegularExpressions.RegexOptions.Compiled);
|
// no array bracket, they need to replace, for unique names for used types in methods
|
||||||
|
public static System.Text.RegularExpressions.Regex IllegalCharsReplace = new System.Text.RegularExpressions.Regex(@"[&.,+$<>{}\-\`\\'/\\ \(\)\*!=]", System.Text.RegularExpressions.RegexOptions.Compiled);
|
||||||
public static string Final(string xName) {
|
public static string Final(string xName) {
|
||||||
//var xSB = new StringBuilder(xName);
|
//var xSB = new StringBuilder(xName);
|
||||||
|
|
||||||
|
|
@ -47,6 +48,7 @@ namespace Cosmos.Assembler {
|
||||||
xSB.Replace(c.ToString(), "");
|
xSB.Replace(c.ToString(), "");
|
||||||
}*/
|
}*/
|
||||||
xName = IllegalCharsReplace.Replace(xName, string.Empty);
|
xName = IllegalCharsReplace.Replace(xName, string.Empty);
|
||||||
|
xName = xName.Replace("[]", "array");
|
||||||
if (xName.Length > MaxLengthWithoutSuffix) {
|
if (xName.Length > MaxLengthWithoutSuffix) {
|
||||||
using (var xHash = MD5.Create()) {
|
using (var xHash = MD5.Create()) {
|
||||||
var xValue = xHash.ComputeHash(Encoding.Default.GetBytes(xName));
|
var xValue = xHash.ComputeHash(Encoding.Default.GetBytes(xName));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue