Differences From
Artifact [e99572ed87]:
3 3 -- completely breaks the cortav build process, so we supply our own
4 4 -- ultra-simplistic and painfully primitive luac replacement.
5 5 -- this does not generate very good object code.
6 6 -- pass luac-broken=1 when building to use
7 7 local pgm = ""
8 8 local strip = os.getenv("strip")=="1"
9 9 if #arg > 1 then
10 - local chunks = {}
10 + local chunks = {'local load=load;'}
11 11 for i, f in ipairs(arg) do
12 12 local nc = assert(loadfile(f))
13 13 nc = string.format("load%q(...)", string.dump(nc))
14 14 table.insert(chunks, nc)
15 15 end
16 - pgm = assert(string.dump(load(table.concat(chunks))))
16 + pgm = string.dump(assert(load(table.concat(chunks))))
17 17 else
18 - pgm = assert(string.dump(loadfile(arg[1])))
18 + pgm = string.dump(assert(loadfile(arg[1])))
19 19 end
20 20
21 21 io.stdout:write(pgm)