1.0.2 • Published 4 years ago

luacodegen v1.0.2

Weekly downloads
1,740
License
ISC
Repository
github
Last release
4 years ago

luacodegen

luacodegen generates lua code from an ast. It is intended to be used with the tree produced by luaparse but this is not a hard requirement. The code generated is intended to have exactly the same ast as the initial input except with better formatting.

Example

const luaparse = require("luaparse");
const luacodegen = require("luacodegen");

const tree = luaparse.parse("local function a(b) if (b) then return 1 else return 2 end end");
const code = luacodegen(tree);
/*
local function a (b)
	if (b) then
		return 1;
	else
		return 2;
	end
end
*/