Engine 0.0.6
Game engine in lua
Loading...
Searching...
No Matches
compiler.lua
Go to the documentation of this file.
1local function build(src_in, bin_out)
2 local src_file = io.open(src_in, 'r')
3
4 if not src_file then
5 return false, 'file not found: '..src_in
6 end
7
8 local content = src_file:read('*a')
9 local bytecode1 = loadstring and loadstring(content) or load(content)
10 local bytecode2 = string.dump(bytecode1, true)
11 src_file:close()
12
13 local bin_file = io.open(bin_out, 'wb')
14 bin_file:write(bytecode2)
15 bin_file:close()
16 return true
17end
18
19local P = {
20 build = build
21}
22
23return P
build
Definition build.lua:20
local function dump()
function love load(args)