Fixed decompile error for methods with invalid C# names

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-05 17:10:31 +02:00
1 親 c1fe54c63e
コミット d4e3e20048
1ファイル変更
+4 -3
+4 -3
ファイルの表示
@@ -207,9 +207,10 @@ namespace ComputeSharp.Shaders.Translation
private string GetSyntaxTreeForStaticMethod(MethodInfo methodInfo)
{
string
sourceCode = DecompileMethodOrDeclaringType(methodInfo),
prototype = sourceCode.Split(Environment.NewLine)[0],
commentedSourceCode = $"// {methodInfo.Name}{Environment.NewLine}{sourceCode}",
sourceCode = DecompileMethodOrDeclaringType(methodInfo, true),
methodFixedCode = sourceCode.Replace(methodInfo.Name, methodInfo.Name.Replace("<", string.Empty).Replace(">", "_")),
prototype = methodFixedCode.Split(Environment.NewLine)[0],
commentedSourceCode = $"// {methodInfo.Name}{Environment.NewLine}{methodFixedCode}",
inFixedSourceCode = Regex.Replace(commentedSourceCode, @"(?<!\w)in ", string.Empty),
outFixedSourceCode = RefactorInlineOutDeclarations(inFixedSourceCode, methodInfo.Name);