From 164b4ceae2e909638cdfd35131cfaa2a48876a7e Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 25 Dec 2015 00:14:37 -0800 Subject: [PATCH] remove debugging stuff; add fixme --- lips.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lips.lua b/lips.lua index 65d1643..f86ce4b 100644 --- a/lips.lua +++ b/lips.lua @@ -669,13 +669,11 @@ end function Lexer:lex_string(yield) -- TODO: support escaping if self.chr ~= '"' then - print(self.chr, self.ord) self:error("expected opening double quote") end self:nextc() local buff = self:read_chars('[^"\n]') if self.chr ~= '"' then - print(self.chr) self:error("expected closing double quote") end self:nextc() @@ -1018,6 +1016,8 @@ function Parser:instruction() local h = instructions[name] self:advance() + -- FIXME: errors thrown here probably have the wrong line number (+1) + if h == nil then self:error('undefined instruction') elseif h == 'LI' then @@ -1346,7 +1346,6 @@ function Parser:parse(asm) end 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) end