Codebase list lua-ldoc / 3f57e43
Issue #248 overeager error messages for module-level fields Steve Donovan 7 years ago
1 changed file(s) with 9 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
297297 is_local = false
298298 end
299299 end
300
300301 if item_follows or comment_contains_tags(comment,args) then
301302 tags = extract_tags(comment,args)
302303
324325 doc.expand_annotation_item(tags,current_item)
325326 -- if the item has an explicit name or defined meaning
326327 -- then don't continue to do any code analysis!
327 local field_or_param = (tags.field or tags.param) and not tags.class
328 -- Watch out for the case where there are field or param tags
329 -- but no class, since these will be fixed up later as module/class
330 -- entities
331 if (tags.field or tags.param) and not tags.class then
332 parse_error = false
333 end
328334 if tags.name then
329335 if not tags.class then
330336 F:warning("no type specified, assuming function: '"..tags.name.."'")
349355 ldoc_comment = false
350356 end
351357 end
352 -- Watch out for the case where there are field or param tags
353 -- but no class, since these will be fixed up later as module/class
354 -- entities
355 elseif parse_error and not field_or_param then
358 end
359 if parse_error then
356360 F:warning('definition cannot be parsed - '..parse_error)
357361 end
358362 end