1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-06-01 06:53:06 -07:00

remove obsolete comments; move a function

This commit is contained in:
Connor Olding 2015-12-02 08:30:52 -08:00
parent 5544c5226b
commit 08472cdc1a

View File

@ -414,7 +414,6 @@ local instructions = {
SNEIU = {}, SNEIU = {},
SNEU = {}, SNEU = {},
-- TODO: immediate, unsigned, likely versions?
BEQI = {}, BEQI = {},
BNEI = {}, BNEI = {},
BGE = {}, BGE = {},
@ -548,23 +547,6 @@ function Lexer:read_binary()
return num return num
end end
function Lexer:lex_block_comment(yield)
while true do
if self.chr == '\n' then
self:nextc()
yield('EOL', '\n')
elseif self.ord == self.EOF then
self:error('unexpected EOF; incomplete block comment')
elseif self.chrchr == '*/' then
self:nextc()
self:nextc()
break
else
self:nextc()
end
end
end
function Lexer:read_number() function Lexer:read_number()
if self.chr == '%' then if self.chr == '%' then
self:nextc() self:nextc()
@ -643,6 +625,23 @@ function Lexer:lex_hex(yield)
end end
end end
function Lexer:lex_block_comment(yield)
while true do
if self.chr == '\n' then
self:nextc()
yield('EOL', '\n')
elseif self.ord == self.EOF then
self:error('unexpected EOF; incomplete block comment')
elseif self.chrchr == '*/' then
self:nextc()
self:nextc()
break
else
self:nextc()
end
end
end
function Lexer:lex(yield) function Lexer:lex(yield)
while true do while true do
if self.chr == '\n' then if self.chr == '\n' then
@ -1285,7 +1284,6 @@ function Dumper:add_directive(line, name, a, b)
local b1 = math.floor(a/0x100) % 0x100 local b1 = math.floor(a/0x100) % 0x100
self:add_bytes(line, b1, b0) self:add_bytes(line, b1, b0)
elseif name == 'WORD' then elseif name == 'WORD' then
-- TODO: ensure lua numbers being floats doesn't cause accuracy issues
local b0 = a % 0x100 local b0 = a % 0x100
local b1 = math.floor(a/0x100) % 0x100 local b1 = math.floor(a/0x100) % 0x100
local b2 = math.floor(a/0x10000) % 0x100 local b2 = math.floor(a/0x10000) % 0x100