mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
assert
This commit is contained in:
parent
6d5dbf7237
commit
5c44d98775
@ -18,7 +18,7 @@ local lookup_line
|
||||
lookup_line = function(fname, pos, cache)
|
||||
if not cache[fname] then
|
||||
do
|
||||
local _with_0 = io.open(fname)
|
||||
local _with_0 = assert(io.open(fname))
|
||||
cache[fname] = _with_0:read("*a")
|
||||
_with_0:close()
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ user_error = (...) ->
|
||||
-- find the line number of `pos` chars into fname
|
||||
lookup_line = (fname, pos, cache) ->
|
||||
if not cache[fname]
|
||||
with io.open fname
|
||||
with assert io.open(fname)
|
||||
cache[fname] = \read "*a"
|
||||
\close!
|
||||
pos_to_line cache[fname], pos
|
||||
|
Loading…
Reference in New Issue
Block a user