Issue #96: was expecting a space after ## in markdown documents; better support for C types
This commit is contained in:
parent
7a7865f300
commit
7e2e6e975c
|
@ -1019,6 +1019,7 @@ local function reference (s, mod_ref, item_ref)
|
|||
end
|
||||
|
||||
function Module:process_see_reference (s,modules,istype)
|
||||
if s == nil then return nil end
|
||||
local mod_ref,fun_ref,name,packmod
|
||||
local ref = custom_see_references(s)
|
||||
if ref then return ref end
|
||||
|
|
|
@ -190,7 +190,6 @@ function html.generate_output(ldoc, args, project)
|
|||
|
||||
local types = {}
|
||||
for name in tp:gmatch("[^|]+") do
|
||||
--local sym, rest = name:match('(%S+)%s*([%*%&])')
|
||||
local sym = name:match '([%w%.%:]+)'
|
||||
local ref,err = markup.process_reference(sym,true)
|
||||
if ref then
|
||||
|
|
|
@ -285,28 +285,26 @@ function CC:item_follows (t,v,tok)
|
|||
if v == self.extra.export then -- this is not part of the return type!
|
||||
t,v = tnext(tok)
|
||||
end
|
||||
-- TBD collecting types which are not single tokens (may contain '*')
|
||||
local return_type = v
|
||||
-- types may have multiple tokens: example, const char *bonzo(...)
|
||||
local return_type, name = v
|
||||
t,v = tnext(tok)
|
||||
if t == 'iden' or t=='keyword' then
|
||||
local name = v
|
||||
name = v
|
||||
t,v = tnext(tok)
|
||||
while t ~= '(' do
|
||||
return_type = return_type .. ' ' .. name
|
||||
name = v
|
||||
t,v = tnext(tok)
|
||||
if t ~= '(' then
|
||||
return_type = return_type .. ' ' .. name
|
||||
name = v
|
||||
t,v = tnext(tok)
|
||||
end
|
||||
--print ('got',name,t,v,return_type)
|
||||
return function(tags,tok)
|
||||
if not tags.name then
|
||||
tags:add('name',name)
|
||||
end
|
||||
--print ('got',name,t,v,return_type)
|
||||
return function(tags,tok)
|
||||
if not tags.name then
|
||||
tags:add('name',name)
|
||||
end
|
||||
tags:add('class','function')
|
||||
if t == '(' then
|
||||
tags.formal_args,t,v = tools.get_parameters(tok,')',',',self)
|
||||
if return_type ~= 'void' then
|
||||
tags.formal_args.return_type = return_type
|
||||
end
|
||||
tags:add('class','function')
|
||||
if t == '(' then
|
||||
tags.formal_args,t,v = tools.get_parameters(tok,')',',',self)
|
||||
if return_type ~= 'void' then
|
||||
tags.formal_args.return_type = return_type
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,7 +57,7 @@ end
|
|||
-- they can appear in the contents list as a ToC.
|
||||
function markup.add_sections(F, txt)
|
||||
local sections, L, first = {}, 1, true
|
||||
local title_pat_end, title_pat = '[^#]%s*(.+)'
|
||||
local title_pat
|
||||
for line in stringx.lines(txt) do
|
||||
if first then
|
||||
local level,header = line:match '^(#+)%s*(.+)'
|
||||
|
@ -66,7 +66,8 @@ function markup.add_sections(F, txt)
|
|||
else
|
||||
level = '##'
|
||||
end
|
||||
title_pat = '^'..level..title_pat_end
|
||||
title_pat = '^'..level..'([^#]%s*.+)'
|
||||
title_pat = stringx.lstrip(title_pat)
|
||||
first = false
|
||||
end
|
||||
local title = line:match (title_pat)
|
||||
|
|
Loading…
Reference in New Issue