KvanTTT / CSharp-Minifier

Library for C# code minification based on NRefactory. That is lib for spaces, line breaks, comments removing, reduction of identifiers name length and so on in C# code.
Apache License 2.0
41 stars 21 forks source link

The new node 'ExpressionStatement' is not valid in the role TryBlock #41

Closed BaconFist closed 6 years ago

BaconFist commented 6 years ago

Environment

Description I've got the Exception The new node 'ExpressionStatement' is not valid in the role TryBlock while trying to minify a class I made. Exception: https://pastebin.com/3PqyyLdB I added an try-catch block an I think it causes the exception.

Code I tried to minify: https://pastebin.com/gHeYAcSs I think its the try-catch in line 167 causing this

Reproduce

  1. open in VS
  2. set CSharpMinifier.GUI as Start Project
  3. start
  4. insert code with try-catch
  5. hit minify
  6. exception