phoney error message when bad ref is in module summary sorted; no-doc-comment error now has line number

This commit is contained in:
steve donovan 2011-08-28 15:37:06 +02:00
parent 6832e1de2d
commit e71f7d89ca
3 changed files with 7 additions and 4 deletions

View File

@ -88,6 +88,7 @@ return [==[
# if ldoc.body then -- verbatim HTML as contents; 'non-code' entries
$(ldoc.body)
# elseif module then -- module documentation
# ldoc.item = module -- context for M()
<p>$(M(module.summary))</p>
<p>$(M(module.description))</p>

View File

@ -307,6 +307,8 @@ function Item:error(msg)
os.exit(1)
end
Module.warning, Module.error = Item.warning, Item.error
function Module:hunt_for_reference (packmod, modules)
local mod_ref
local package = self.package or ''
@ -380,7 +382,6 @@ end
-- and try to to resolve this.
function Module:resolve_references(modules)
local found = List()
for item in self.items:iter() do
local see = item.tags.see
if see then -- this guy has @see references

View File

@ -88,9 +88,10 @@ local function parse_file(fname,lang, package)
function filename () return fname end
function F:warning (msg,kind)
function F:warning (msg,kind,line)
kind = kind or 'warning'
io.stderr:write(kind..' '..fname..':'..lineno()..': '..msg,'\n')
line = line or lineno()
io.stderr:write(kind..' '..fname..':'..line..': '..msg,'\n')
end
function F:error (msg)
@ -183,7 +184,7 @@ local function parse_file(fname,lang, package)
add_module(tags,module_found,old_style)
tags = nil
if not t then
io.stderr:write('warning: ',fname,' contains no items\n')
F:warning(fname,' contains no items\n','warning',1)
break;
end -- run out of file!
-- if we did bump into a doc comment, then we can continue parsing it