diff --git a/ILTransform/ILRewriter.cs b/ILTransform/ILRewriter.cs index 726de18..56d3b6d 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.RelativePath, out _, out string sourceName, out _); if (sourceName != assemblyName) { string end = line.Substring(identEnd); @@ -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) 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" };