Issue #248 overeager error messages for module-level fields
This commit is contained in:
parent
09b9fdbdd6
commit
3f57e431a2
|
@ -298,6 +298,7 @@ local function parse_file(fname, lang, package, args)
|
|||
is_local = false
|
||||
end
|
||||
end
|
||||
|
||||
if item_follows or comment_contains_tags(comment,args) then
|
||||
tags = extract_tags(comment,args)
|
||||
|
||||
|
@ -325,7 +326,12 @@ local function parse_file(fname, lang, package, args)
|
|||
doc.expand_annotation_item(tags,current_item)
|
||||
-- if the item has an explicit name or defined meaning
|
||||
-- then don't continue to do any code analysis!
|
||||
local field_or_param = (tags.field or tags.param) and not tags.class
|
||||
-- Watch out for the case where there are field or param tags
|
||||
-- but no class, since these will be fixed up later as module/class
|
||||
-- entities
|
||||
if (tags.field or tags.param) and not tags.class then
|
||||
parse_error = false
|
||||
end
|
||||
if tags.name then
|
||||
if not tags.class then
|
||||
F:warning("no type specified, assuming function: '"..tags.name.."'")
|
||||
|
@ -350,10 +356,8 @@ local function parse_file(fname, lang, package, args)
|
|||
ldoc_comment = false
|
||||
end
|
||||
end
|
||||
-- Watch out for the case where there are field or param tags
|
||||
-- but no class, since these will be fixed up later as module/class
|
||||
-- entities
|
||||
elseif parse_error and not field_or_param then
|
||||
end
|
||||
if parse_error then
|
||||
F:warning('definition cannot be parsed - '..parse_error)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue