Browse Source

#2590: Fix printing of "Invalid MethodBodyBlock" comments. Make them appear between the braces of the block.

pull/2595/head
Siegfried Pammer 3 years ago
parent
commit
2a7e9c1d78
  1. 2
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

2
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -1521,6 +1521,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1521,6 +1521,8 @@ namespace ICSharpCode.Decompiler.CSharp
{
body = new BlockStatement();
body.AddChild(new Comment("Invalid MethodBodyBlock: " + ex.Message), Roles.Comment);
// insert explicit rbrace token to make the comment appear within the braces
body.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.RBrace), Roles.RBrace);
entityDecl.AddChild(body, Roles.Body);
return;
}

Loading…
Cancel
Save