css minification

via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 18 10:34:30 PST 2015


On Sunday, 18 January 2015 at 17:46:52 UTC, Andrei Alexandrescu 
wrote:
> On 1/18/15 9:41 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= 
> <schuetzm at gmx.net>" wrote:
>> On Saturday, 17 January 2015 at 18:00:01 UTC, Andrei 
>> Alexandrescu wrote:
>>> Would be a nice tools/ thing. Wanna do it/ --- Andrei
>>
>> First try:
>>
>> https://github.com/schuetzm/shrinkcss/blob/master/shrinkcss.d
>>
>> Reads from stdin, writes to stdout. Removes comments, 
>> superfluous
>> whitespace, and the closing ";" before "}".
>>
>> WARNING: This is mostly untested, the lexer is probably 
>> missing a few
>> corner cases.
>
> Noice. Would be interesting to see how much Brian's lexer 
> generator would help. If it reduces size considerably or makes 
> it a lot easier to do things, that would be a good proof of 
> utility. -- Andrei

It might help, maybe I'll try it out (not today, though). One 
improvement I'd like to have would be to avoid the duplication of 
the `case`s of `lex()` in the `readXXX()` functions.


More information about the Digitalmars-d mailing list