davidvarga / MBeautifier

MBeautifier is a MATLAB source code formatter, beautifier. It can be used directly in the MATLAB Editor and it is configurable.
GNU General Public License v3.0
483 stars 77 forks source link

Code is broken on "clear -global varnames" #108

Closed FlorianPfaff closed 2 years ago

FlorianPfaff commented 3 years ago

Hi,

thanks for this very nice tool. I just wanted to report that it broke some code. I had a line clear -global x y in my code and it made clear - global x y out of it. Matlab then did not execute the code due to the illegal use of the global keyword.

I just thought I would let you know in case you want to fix this. A good fix would be to prevent that strings involving keywords (global, persistent, for, if, else, while, end) that do not start with the keyword itself are broken up because it will certainly change how Matlab interprets the code.

Thanks again for the great tool,

Florian

davidvarga commented 2 years ago

Hi Florian,

are you still able to reproduce this?

Thanks, David

FlorianPfaff commented 2 years ago

Hi David,

no, it looks fine now. Thanks a lot for your efforts!

Best wishes,

Florian