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. -X,--not_luadoc break LuaDoc compatibility. Descriptions may continue after tags.
-D,--define (default none) set a flag to be used in config.ld -D,--define (default none) set a flag to be used in config.ld
-C,--colon use colon style -C,--colon use colon style
-N,--no_args_infer don't infer arguments from source
-B,--boilerplate ignore first comment in source files -B,--boilerplate ignore first comment in source files
-M,--merge allow module merging -M,--merge allow module merging
-S,--simple no return or params, no summary -S,--simple no return or params, no summary
@ -239,7 +240,8 @@ local ldoc_contents = {
'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references', 'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords', 'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
'postprocess_html', 'postprocess_html',
'custom_css','version' 'custom_css','version',
'no_args_infer'
} }
ldoc_contents = tablex.makeset(ldoc_contents) ldoc_contents = tablex.makeset(ldoc_contents)
@ -424,6 +426,7 @@ local process_file_list = tools.process_file_list
setup_package_base() setup_package_base()
override 'no_args_infer'
override 'colon' override 'colon'
override 'merge' override 'merge'
override 'not_luadoc' override 'not_luadoc'

View File

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