1
0
mirror of https://github.com/Adorable-Catgirl/LuaComp.git synced 2024-11-23 10:28:06 +11:00

This should work questionmark.

This commit is contained in:
Jane Roxanne 2020-03-18 13:23:39 -05:00
parent ed6f0a227b
commit fbb270ee4a
7 changed files with 25 additions and 6 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
luacomp.lua luacomp.lua
luacomp
build/*

View File

18
make_release.lua Normal file
View File

@ -0,0 +1,18 @@
local luaexec = {
"5.4",
"5.3",
"5.2",
"5.1",
"jit"
}
os.execute("rm -rf build")
os.execute("mkdir build")
for i=1, #luaexec do
os.execute("luacomp -xlua"..luaexec[i].." -mluamin -O build/luacomp-"..luaexec[i].." src/init.lua")
os.execute("luacomp -xlua"..luaexec[i].." -mnone -O build/luacomp-static-"..luaexec[i].." src/staticinit.lua")
os.execute("chmod +x build/luacomp-"..luaexec[i])
os.execute("chmod +x build/luacomp-static-"..luaexec[i])
end
os.execute("cp -v build/luacomp-".._VERSION:sub(5).." luacomp")

View File

@ -62,7 +62,7 @@ else
end end
dprint("Generating AST...") dprint("Generating AST...")
local ast = mkast(f, file) local ast = mkast(f, file)
ast.file = f ast.file = file
dprint("Generating code...") dprint("Generating code...")
local ocode = generate(ast, args.generator_code) local ocode = generate(ast, args.generator_code)

View File

@ -6,6 +6,6 @@ function directives.include(env, file)
local fast = mkast(f, file) local fast = mkast(f, file)
fast.file = file fast.file = file
local code = generate(fast) local code = generate(fast)
env.code = env.code .. "\n" .. code .. "\n" env.code = env.code .. code .. "\n"
return true return true
end end

View File

@ -104,8 +104,8 @@ local function generate(ast, gencode)
for k, v in pairs(vars) do for k, v in pairs(vars) do
vstr = vstr .. k.."=".."\""..svar_escape(v).."\" " vstr = vstr .. k.."=".."\""..svar_escape(v).."\" "
end end
dprint("Shell", vstr .. f.." 2>"..tname) dprint("Shell", vstr .. f.." "..tname)
local h = io.popen(vstr .. f.." 2>"..tname, "r") local h = io.popen(vstr .. f.." "..tname, "r")
local output = h:read("*a"):gsub("\n$", "") local output = h:read("*a"):gsub("\n$", "")
local ok, sig, code = h:close() local ok, sig, code = h:close()
fh = io.open(tname, "r") fh = io.open(tname, "r")

View File

@ -18,4 +18,3 @@
local argparse = require("argparse") local argparse = require("argparse")
--#include "src/application.lua" --#include "src/application.lua"
---#include "src/application.lua" @[{test}]