From 82ead2edbf1ca07f4065627cb5a210a032931169 Mon Sep 17 00:00:00 2001 From: Brian Bohe Date: Tue, 21 Feb 2023 16:57:27 -0800 Subject: [PATCH 1/4] Matching ilproj name with assembly on -a --- ILTransform/ILRewriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILTransform/ILRewriter.cs b/ILTransform/ILRewriter.cs index 726de18..ba2c248 100644 --- a/ILTransform/ILRewriter.cs +++ b/ILTransform/ILRewriter.cs @@ -556,7 +556,7 @@ private void RewriteFile(string source) } } int identEnd = charIndex; - string sourceName = Path.GetFileNameWithoutExtension(source); + TestProject.GetKeyNameRootNameAndSuffix(_testProject.TestProjectAlias, out _, out string sourceName, out _); if (sourceName != assemblyName) { string end = line.Substring(identEnd); From b0ce0637fc9a3615dcc3395c3ec66fb43561c4c4 Mon Sep 17 00:00:00 2001 From: Brian Bohe Date: Tue, 21 Feb 2023 16:58:13 -0800 Subject: [PATCH 2/4] Extending def token list --- ILTransform/ILRewriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILTransform/ILRewriter.cs b/ILTransform/ILRewriter.cs index ba2c248..fbaffcb 100644 --- a/ILTransform/ILRewriter.cs +++ b/ILTransform/ILRewriter.cs @@ -734,7 +734,7 @@ private static bool IsTypePrefix(List tokens, List kinds, int && ((tokens[index + 1] == "::") || (tokens[index + 1] == "/")) // type::field or type::nestedtype && (kinds[index + 2] == TokenKind.Identifier || kinds[index + 2] == TokenKind.SingleQuoted); - private static string[] TypeDefTokens = { "public", "auto", "ansi" }; + private static string[] TypeDefTokens = { "public", "abstract", "auto", "ansi", "sealed", "beforefieldinit" }; private static bool IsTypeNameDef(List tokens, List kinds, int index) { for (; index >= 2; index -= 2) From 803b57726a03f62f77cc1691a1903ecd71b6fc53 Mon Sep 17 00:00:00 2001 From: Brian Bohe Date: Tue, 21 Feb 2023 16:58:50 -0800 Subject: [PATCH 3/4] Extending special token list --- ILTransform/TestProject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILTransform/TestProject.cs b/ILTransform/TestProject.cs index c4abc08..85ca477 100644 --- a/ILTransform/TestProject.cs +++ b/ILTransform/TestProject.cs @@ -239,7 +239,7 @@ public static bool MakePublic(bool isILTest, ref string line, bool force) public static List SpecialTokens() => new List { "add", "and", "br", "brtrue", "brfalse", "ble", "blt", "beq", "bge", "bgt", "call", "ceq", "cgt", "ckfinite", "clt", "cpblk", "div", - "dup", "filter", "finally", "initblk", "jmp", "ldobj", "ldtoken", "mul", "neg", "nested", "nop", "rem", "ret", "sub", "xor", "callvirt", + "dup", "filter", "finally", "initblk", "jmp", "ldobj", "ldtoken", "ldftn", "mul", "neg", "nested", "nop", "rem", "ret", "sub", "xor", "callvirt", "castclass", "cpobj", "initobj", "isinst", "switch", "rethrow" }; From e0fc561e14295f0cfdf369fe378e5507fef1c363 Mon Sep 17 00:00:00 2001 From: Brian Bohe Date: Wed, 22 Feb 2023 16:33:48 -0800 Subject: [PATCH 4/4] Using relative path ilproj filename to match assembly name --- ILTransform/ILRewriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILTransform/ILRewriter.cs b/ILTransform/ILRewriter.cs index fbaffcb..56d3b6d 100644 --- a/ILTransform/ILRewriter.cs +++ b/ILTransform/ILRewriter.cs @@ -556,7 +556,7 @@ private void RewriteFile(string source) } } int identEnd = charIndex; - TestProject.GetKeyNameRootNameAndSuffix(_testProject.TestProjectAlias, out _, out string sourceName, out _); + TestProject.GetKeyNameRootNameAndSuffix(_testProject.RelativePath, out _, out string sourceName, out _); if (sourceName != assemblyName) { string end = line.Substring(identEnd);