Hi everyone,
My new project uses massive tables of graphics metadata, so I've written a new table serializer inspired by this pull request on @BenWiley4000's pico8-table-string to get the job done. Hopefully someone else finds this useful, too!
It uses less characters to store your table as a string than pico8-table-string does (to take up less character / compressed space), but at the cost of 14 more tokens to deserialize, and possibly with less reliability. (It will break if the table contains a string a certain character sequence, see below.) You should also run the output through something like Zep's escape_binary_string before saving to code.
Supported:
- string/number/boolean values
- key/value pairs
- consecutive indexed values starting from 1
Not supported:
- 0-indexed values
- non-consecutive indexed values
- strings containing the ascii sequence
\3\120\23
Writing parsers is not one of my strengths, so pull requests on the GitHub repo are open and appreciated!
serialize
deserialize
usage
[Please log in to post a comment]