new flag: -N,--no_args_infer don't infer arguments from source

This commit is contained in:
Steve Donovan 2016-06-24 15:53:15 +02:00
parent ff0eebceb2
commit 1bcd76e307
2 changed files with 10 additions and 5 deletions

View File

@ -58,6 +58,7 @@ ldoc, a documentation generator for Lua, vs ]]..version..[[
-X,--not_luadoc break LuaDoc compatibility. Descriptions may continue after tags.
-D,--define (default none) set a flag to be used in config.ld
-C,--colon use colon style
-N,--no_args_infer don't infer arguments from source
-B,--boilerplate ignore first comment in source files
-M,--merge allow module merging
-S,--simple no return or params, no summary
@ -68,7 +69,7 @@ ldoc, a documentation generator for Lua, vs ]]..version..[[
--tags (default none) show all references to given tags, comma-separated
--fatalwarnings non-zero exit status on any warning
--testing reproducible build; no date or version on output
<file> (string) source file or directory containing source
`ldoc .` reads options from an `config.ld` file in same directory;
@ -239,7 +240,8 @@ local ldoc_contents = {
'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
'postprocess_html',
'custom_css','version'
'custom_css','version',
'no_args_infer'
}
ldoc_contents = tablex.makeset(ldoc_contents)
@ -424,6 +426,7 @@ local process_file_list = tools.process_file_list
setup_package_base()
override 'no_args_infer'
override 'colon'
override 'merge'
override 'not_luadoc'
@ -810,7 +813,7 @@ ldoc.package = args.package:match '%a+' and args.package or nil
local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
if args.testing then
ldoc.updatetime = "2015-01-01 12:00:00"
ldoc.version = 'TESTING'
ldoc.version = 'TESTING'
elseif source_date_epoch == nil then
if args.date == 'system' then
ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")

View File

@ -225,7 +225,7 @@ local function parse_file(fname, lang, package, args)
return nil
end
end
if lang.parse_module_call and t ~= 'comment'then
if lang.parse_module_call and t ~= 'comment' then
while t and not (t == 'iden' and v == 'module') do
t,v = tnext(tok)
end
@ -314,7 +314,9 @@ local function parse_file(fname, lang, package, args)
tags:add('class','function')
end
item_follows, is_local = false, false
elseif lang:is_module_modifier (tags) then
elseif args.no_args_infer then
F:error("No name and type provided (no_args_infer)")
elseif lang:is_module_modifier (tags) then
if not item_follows then
F:warning("@usage or @export followed by unknown code")
break