0.4.1 • Published 1 year ago

pico8parse v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This is a fork of the luaparse by Oskar Schöldström (and other).

See the original README or the linked GitHub above for more information about it. If the intention is to use the present JavaScript package, the original README is probably the first thing to look at.

The intention is to add support for the PICO-8 flavour of Lua which brings a few new syntaxes, tokens and a whole file format (all described here).

A Fork of the luaparse

A few changes were made regarding the versions of Lua that were already supported by the original luaparse:

  • from Lua 5.2 onward, hex numerals may start with a dot: a = 0x.A is valid
  • the parser state would not be entirely reset (which had no impact until it did)
  • maybe that's wrong but longstring comments were discarding any first newline right after the last [
  • TableCallExpression nodes presented an arguments property (duplicate of argument) which was removed
  • module default export

Ideally, no breaking changes were added in regard to the parsing of Lua 5.1, 5.2, 5.3 and LuaJIT. These versions should still behave the same outside of the mentioned points above. Hopefully, this fork would stay up-to-date with its upstream.

Other Mentions and Thanks

The PICO-8 Wikia proved a great help at gathering random information about the API.

As well as the luacheck project and the picotool.

And obviously zep @lexaloffle and their PICO-8 fantasy console.