This repository contains a luajit/lua 5.2 parser and pretty printer implemented in OCaml. It has been reasonably well tested and any code parsed and pretty printed should execute correctly. If not please submit an issue.
As long as you have a current version of opam, installation is as simple as:
$ opam install lua_parser
You can then use it to parse and print lua code:
$ l2l -lua file1.lua