cortav  Check-in [72cb09e451]

Overview
Comment:fix some bugs in luac.lua
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72cb09e4513d032411a3759a43447e97fac547f5d56f574d9c28d262da60f2f4
User & Date: lexi on 2022-12-14 08:54:00
Other Links: manifest | tags
Context
2022-12-14
09:40
add namespace/source commentary sections; get scope directives working check-in: b5a3802b71 user: lexi tags: trunk
08:54
fix some bugs in luac.lua check-in: 72cb09e451 user: lexi tags: trunk
08:43
add workaround for broken luac check-in: f673b2abfe user: lexi tags: trunk
Changes

Modified tool/luac.lua from [e99572ed87] to [b98a323553].

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

io.stdout:write(pgm)







|





|

|



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

io.stdout:write(pgm)