require embedded filenames

This commit is contained in:
2025-08-03 16:13:03 -07:00
parent 3cc1287dc4
commit 03b4d86e47

View File

@@ -137,13 +137,19 @@ function splubp:wnx(...)
return self["write_"..self:op()](self, ...) return self["write_"..self:op()](self, ...)
end end
function splubp:emit_item(obj, filename) -- write an object of a known type.
-- item must have a field named
-- _file, containing a filename
-- with a correct extension
-- to save the file under.
function splubp:emit_item(obj)
if DEBUG then if DEBUG then
--[[global]] splubp_last_emit = obj --[[global]] splubp_last_emit = obj
end end
filename = filename or obj._file -- todo: should _addr skip the
-- filename, instead?
obj._addr = self.ptr obj._addr = self.ptr
self:write_s(filename) self:write_s(obj._file)
for row in all(self.fmts[split(filename, ".")[2]]) do for row in all(self.fmts[split(filename, ".")[2]]) do
local alt = self.wdirectives[row[1]] local alt = self.wdirectives[row[1]]
if alt then if alt then