Closed piyagee closed 12 years ago
Hi,
First of all thanks for the code. The problem with preserving comments is that too many rules in the parser will have to be changed to support that. It's a lot of work and doesn't benefit the minifier.
I checked both UglifyJS and Google Closure and they don't preserve comments either:
I like your idea to preserve a license header though and if you feel like adding support for that you're more than welcome. Feel free to ask me any question regarding that.
The idea was to extend parser so it could potentially support not only license but commented code annotations + conceptually code prettifier is broken if it omits comments. But you are definitely right that this is out focus of this lib, so i'm closing this request. Thank you for looking into this )
This is a pretty useful thing. It would allow the library to be used as a dependency manager of JavaScript files, where dependencies are defined in JS comments
Added partial support for LineComment and BlockComment Node(s) for parser and all visitors + fixed potentially broken lextab and yacctab modules generation (corner cases of missing modules and python egg as zip file)
Currently inline comments are not supported (it is not clear for me now where to put comment node if it's in the middle of some expression)
PS i wanted to make this pull request into develop branch, but looks like it was not merged with master for some time.