mirror of
https://github.com/notwa/lips
synced 2024-05-04 10:33:22 -07:00
allow Preproc to throw errors again
This commit is contained in:
parent
8aa3c58f8f
commit
067267c313
|
@ -1,4 +1,5 @@
|
||||||
local abs = math.abs
|
local abs = math.abs
|
||||||
|
local format = string.format
|
||||||
local insert = table.insert
|
local insert = table.insert
|
||||||
|
|
||||||
local path = string.gsub(..., "[^.]+$", "")
|
local path = string.gsub(..., "[^.]+$", "")
|
||||||
|
@ -13,6 +14,13 @@ function Preproc:init(options)
|
||||||
self.options = options or {}
|
self.options = options or {}
|
||||||
end
|
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)
|
function Preproc:iter(statements)
|
||||||
assert(statements)
|
assert(statements)
|
||||||
local i = 0
|
local i = 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user