1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-05-02 17:43:23 -07:00

fix incbin directive

This commit is contained in:
Connor Olding 2016-04-24 13:19:18 -07:00
parent 693294bef2
commit f3765a0300

View File

@ -316,11 +316,12 @@ function Lexer:lex_include_binary(_yield)
if self.options.path then
fn = self.options.path..fn
end
-- FIXME: this allocates two tables for each byte.
-- this could easily cause performance issues on big files.
local data = util.readfile(fn, true)
-- FIXME: this allocates a table for each byte.
-- this could easily cause performance issues on big files.
_yield('DIR', 'BYTE', fn, 0)
for b in string.gfind(data, '.') do
_yield('DIR', 'BYTE', fn, 0)
_yield('NUM', string.byte(b), fn, 0)
end
end