1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-04-25 07:03:22 -07:00

allow Preproc to throw errors again

This commit is contained in:
Connor Olding 2016-11-27 20:28:53 -08:00
parent 8aa3c58f8f
commit 067267c313

View File

@ -1,4 +1,5 @@
local abs = math.abs
local format = string.format
local insert = table.insert
local path = string.gsub(..., "[^.]+$", "")
@ -13,6 +14,13 @@ function Preproc:init(options)
self.options = options or {}
end
function Preproc:error(msg, got)
if got ~= nil then
msg = msg..', got '..tostring(got)
end
error(format('%s:%d: Error: %s', self.fn, self.line, msg), 2)
end
function Preproc:iter(statements)
assert(statements)
local i = 0