diff --git a/ldoc/markup.lua b/ldoc/markup.lua index 5b547fc..2ad5614 100644 --- a/ldoc/markup.lua +++ b/ldoc/markup.lua @@ -115,7 +115,7 @@ local function process_multiline_markdown(ldoc, txt, F) local indent,code,start_indent local_context = nil while line do - local name = line:match '@lookup%s+(%S+)' + local name = line:match '^@lookup%s+(%S+)' if name then local_context = name .. '.' line = getline() diff --git a/ldoc/parse.lua b/ldoc/parse.lua index e6d3159..3239b4e 100644 --- a/ldoc/parse.lua +++ b/ldoc/parse.lua @@ -134,6 +134,13 @@ local function parse_file(fname,lang, package) local mod local t,v = tnext(tok) + if t == '#' then + while t and t ~= 'comment' do t,v = tnext(tok) end + if t == nil then + F:warning('empty file') + return nil + 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)