Log In  

I can never resist an opportunity to mess around with regular expressions, so here's my attempt at a code minimizing script.

https://github.com/centuryglass/phantasos/blob/master/minimize.pl

If you already have perl installed, you just need to run 'perl minimize.pl yourcode.p8'. It will output the minimized code to 'yourcode_min.p8". Token mappings are also saved as 'yourcode tokens.txt' to make debugging easier. I've only tested it with my game and a few random carts. Let me know if it doesn't work on your code, I'm sure there are a couple obscure reserved words and odd failure conditions I've missed.

P#43919 2017-09-04 14:39 ( Edited 2017-09-07 03:52)

Nice!

Prior art, for reference (not harshing your project): picotool has a full Lua parser with minifier, among other tools and libs. Python-based.

P#43975 2017-09-06 23:52 ( Edited 2017-09-07 03:52)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 13:13:10 | 0.006s | Q:11