mirror of
https://github.com/notwa/lips
synced 2024-05-18 16:33:22 -07:00
remove debugging stuff; add fixme
This commit is contained in:
parent
67b36f2b07
commit
164b4ceae2
5
lips.lua
5
lips.lua
|
@ -669,13 +669,11 @@ end
|
||||||
function Lexer:lex_string(yield)
|
function Lexer:lex_string(yield)
|
||||||
-- TODO: support escaping
|
-- TODO: support escaping
|
||||||
if self.chr ~= '"' then
|
if self.chr ~= '"' then
|
||||||
print(self.chr, self.ord)
|
|
||||||
self:error("expected opening double quote")
|
self:error("expected opening double quote")
|
||||||
end
|
end
|
||||||
self:nextc()
|
self:nextc()
|
||||||
local buff = self:read_chars('[^"\n]')
|
local buff = self:read_chars('[^"\n]')
|
||||||
if self.chr ~= '"' then
|
if self.chr ~= '"' then
|
||||||
print(self.chr)
|
|
||||||
self:error("expected closing double quote")
|
self:error("expected closing double quote")
|
||||||
end
|
end
|
||||||
self:nextc()
|
self:nextc()
|
||||||
|
@ -1018,6 +1016,8 @@ function Parser:instruction()
|
||||||
local h = instructions[name]
|
local h = instructions[name]
|
||||||
self:advance()
|
self:advance()
|
||||||
|
|
||||||
|
-- FIXME: errors thrown here probably have the wrong line number (+1)
|
||||||
|
|
||||||
if h == nil then
|
if h == nil then
|
||||||
self:error('undefined instruction')
|
self:error('undefined instruction')
|
||||||
elseif h == 'LI' then
|
elseif h == 'LI' then
|
||||||
|
@ -1346,7 +1346,6 @@ function Parser:parse(asm)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Dumper:error(msg)
|
function Dumper:error(msg)
|
||||||
--error(string.format('%s:%d: Dumper Error: %s', '(code)', self.pos, msg), 2)
|
|
||||||
error(string.format('%s:%d: Error: %s', self.fn, self.line, msg), 2)
|
error(string.format('%s:%d: Error: %s', self.fn, self.line, msg), 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user