Don't try to parse a module call if 'module' token is field name

That is, ignore `foo.module()` when looking for module calls.
This commit is contained in:
Peter Melnichenko 2016-07-01 14:31:53 +03:00
parent b903eb79df
commit 3798cb42d3
1 changed files with 7 additions and 2 deletions

View File

@ -231,8 +231,13 @@ local function parse_file(fname, lang, package, args)
end
end
if lang.parse_module_call and t ~= 'comment' then
while t and not (t == 'iden' and v == 'module') do
t,v = tnext(tok)
local prev_token
while t do
if prev_token ~= '.' and prev_token ~= ':' and t == 'iden' and v == 'module' then
break
end
prev_token = t
t, v = tnext(tok)
end
if not t then
if not args.ignore then