Skip to content

Commit

Permalink
Merge pull request #7 from BrianBohe/fix-a_and_extensions
Browse files Browse the repository at this point in the history
Fix -a flag and extend token lists
  • Loading branch information
markples authored Feb 23, 2023
2 parents 317a985 + e0fc561 commit cefdaff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ILTransform/ILRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -734,7 +734,7 @@ private static bool IsTypePrefix(List<string> tokens, List<TokenKind> 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<string> tokens, List<TokenKind> kinds, int index)
{
for (; index >= 2; index -= 2)
Expand Down
2 changes: 1 addition & 1 deletion ILTransform/TestProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static bool MakePublic(bool isILTest, ref string line, bool force)

public static List<string> SpecialTokens() => new List<string> {
"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"
};

Expand Down

0 comments on commit cefdaff

Please sign in to comment.