require embedded filenames
This commit is contained in:
12
splubp.p8
12
splubp.p8
@@ -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
|
||||||
|
Reference in New Issue
Block a user