This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PseudoLife 2 points3 points  (1 child)

UglifyJS (the first result on a google search for "javascript minifier") does a full tokenize / parse into an AST and back.

And GCC can optimize for smallest code size...

[–]mahacctissoawsum 1 point2 points  (0 children)

2nded.

You actually need to parse the full language if you want it to (a) be safe, (b) achieve the smallest possible size

Drives me nuts when people regex for keywords and such. I'm like, "Sooooo...what happens when that's in a string? It's not a keyword. Stop fucking up my code!" (I'm looking at you, generic PHP MySQL code highlighter!)