pico8-to-lua
A library and command line tool to convert Pico-8's dialect of Lua to plain Lua.
Installation
As a library
As a command line tool
Examples
Patch a cart
Patch stdin
|
if )
Patch the Code
use patch_lua;
assert_eq!;
Patch the Includes
use patch_includes;
assert_eq!;
It's recommended to patch the includes before patching the code in practice because the includes may need patching as well.
Omissions
This handles most of the Pico-8 dialect. However, it does not handle the rotation operators: '>><' and '<<>'.
Word of Caution
Don't go trusting this too much because it is merely a collection of regular expressions and not a full blown language parser like it should be.
Origin
This is a port of Ben Wiley's pico8-to-lua Lua tool to Rust. Pico8-to-lua was originally derived from a function in Jez Kabanov's PICOLOVE project.
License
PICOLOVE is licensed under the Zlib license and so is Wiley's pico8-to-lua and so this project is.