@lookup must be first thing; allow for shebang in scripts

This commit is contained in:
steve donovan 2012-03-16 14:42:58 +02:00
parent 9f314ea7fc
commit 5b4fc640de
2 changed files with 8 additions and 1 deletions

View File

@ -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()

View File

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