mirror of
https://github.com/notwa/lips
synced 2024-11-14 14:39:04 -08:00
allow Preproc to throw errors again
This commit is contained in:
parent
8aa3c58f8f
commit
067267c313
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue