On 5/25/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Joshua ben Jore" schreef:
> Adriano Ferreira:
>> Peter Michaux:
>>> I'm writing a new version of JavaScript::Minification on CPAN. This
>>> is my first CPAN module and first Perl project! If someone is
>>> willing to take a look to see if I've done something terribly wrong
>>> packaging the code I would greatly appreciate any feedback.
>>>
>>> Currently the new module is in a subversion repository. If you have
>>> subversion you should be able to check it out and test it with
>>>
>>> svn co http://dev.michaux.ca/svn/random/JavaScript-Minifier
>>> cd JavaScript-Minifier
>>> perl MakeFile.PL
>>> make test
>>
>> Some comments on packaging:
>> * it may be a good idea to add a LICENSE parameter to Makefile.PL
>> (supported by ExtUtils::MakeMaker >= 6.31)
>> * you might like to add POD and POD coverage tests (for CPANTS' sake)
>>
>> Some comments on code:
>> * it does not look like Perl code, but C code translated literally
>> to Perl.
>
> That's because this is a translation of the C program, jsmin.
> http://javascript.crockford.com/jsmin.html
The code contains the strange '\000'.
I see basically 3 steps:
1. respect strings
2. remove comments
3. compress everything else
You may want want to convert from UTF16 to perl native strings, then
convert back. JavaScript is defined as being stored in UTF16 but
that's kind of unusual elsewhere. Isn't it?
Josh