lexer can crash nastily if called beyond end of stream: now always returns nil after the end

This commit is contained in:
steve donovan 2011-08-25 19:00:43 +02:00
parent f1b7c894f7
commit 9d126aa2e7
1 changed files with 1 additions and 0 deletions

View File

@ -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]