cminify icon indicating copy to clipboard operation
cminify copied to clipboard

Invalid output with two nested types of comments

Open pckgit opened this issue 5 years ago • 3 comments

Use case: When the following comment is encountered, all code following the comment is ignored, and so the output is invalid and does no more compile:

/* ...some comments... //*/ code

pckgit avatar Aug 22 '18 06:08 pckgit

cminify does it's thing right. As the line ending the block comment starts with "//" the following text "*/" is ignored.

Arlon1 avatar Aug 24 '18 19:08 Arlon1

I think the issue is legit.

The block comment takes precedence on the inline comment, so the "//" won't comment the block comment end (we're already inside a comment).

Inline comments should be ignored when inside a block comment. kind of a frustrating edge case.

Scylardor avatar Aug 24 '18 21:08 Scylardor

Well, I use this kind of "trick" to comment/uncomment lots of code by typing only one character (add one slash "/" or remove one in the doubled-slash "//" at the beginning of the block comment). It's very useful, and all IDE I've been using for years react correctly with this kind of comment-manner.

Yes, it's kind of a frustrating edge case for me using cminify :)

pckgit avatar Aug 25 '18 10:08 pckgit