mathiasbynens / todo

1 stars 0 forks source link

Lua minifier in JavaScript or PHP #1

Closed mathiasbynens closed 11 years ago

mathiasbynens commented 11 years ago

Like https://github.com/stravant/LuaMinify, but in JavaScript or PHP, so I can more easily optimize the eff out of it, and with unit tests.

Another way to put it: like https://github.com/ariya/esprima, but for Lua instead of JavaScript. ;)

Ok, about the JavaScript version — turns out @oxyc already wrote a very good Lua parser with unit tests, code coverage tests, benchmarks… Should be easy enough to build a minifier on top of that.

oxyc commented 11 years ago

I thought I'd do some marketing: I recently wrote a Lua parser in JavaScript which should be a good starting point for this. It still needs some polishing and feature additions to be production ready. Hopefully I'll get the time to do it soon.

http://oxyc.github.com/luaparse/

mathiasbynens commented 11 years ago

Awesome! I had been looking for one but somehow failed to find yours. I’ll definitely check it out; thanks for posting!

mathiasbynens commented 11 years ago

I’ve already got a working minifier with operator precedence support (which LuaMinify lacks): http://mths.be/luamin Next up: shortening names of local variables.

Closing this issue.

P.S. luaparse is awesome. Thanks, @oxyc!