lexer can crash nastily if called beyond end of stream: now always returns nil after the end
This commit is contained in:
parent
f1b7c894f7
commit
9d126aa2e7
|
@ -207,6 +207,7 @@ function lexer.scan (s,matches,filter,options)
|
|||
end
|
||||
|
||||
function mt.__call ()
|
||||
if not s then return end
|
||||
while true do
|
||||
for _,m in ipairs(matches) do
|
||||
pat,fun = m[1],m[2]
|
||||
|
|
Loading…
Reference in New Issue