mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Fix generated script docs displaying functions twice.
A function prototype can be declared separately from where it's defined; the doc framework should now recognize them as the same and combine reST documentation associated with either case if both are present.
This commit is contained in:
parent
94ac3f3c23
commit
090ce2d03c
4 changed files with 104 additions and 19 deletions
|
@ -16,7 +16,7 @@ BroDocObj::BroDocObj(const ID* id, std::list<std::string>*& reST,
|
|||
|
||||
BroDocObj::~BroDocObj()
|
||||
{
|
||||
delete reST_doc_strings;
|
||||
if ( reST_doc_strings ) delete reST_doc_strings;
|
||||
if ( is_fake_id ) delete broID;
|
||||
}
|
||||
|
||||
|
@ -50,3 +50,17 @@ bool BroDocObj::IsPublicAPI() const
|
|||
return (broID->Scope() == SCOPE_GLOBAL) ||
|
||||
(broID->Scope() == SCOPE_MODULE && broID->IsExport());
|
||||
}
|
||||
|
||||
void BroDocObj::Combine(const BroDocObj* o)
|
||||
{
|
||||
if ( o->reST_doc_strings )
|
||||
{
|
||||
if ( ! reST_doc_strings )
|
||||
reST_doc_strings = new std::list<std::string>();
|
||||
|
||||
reST_doc_strings->splice(reST_doc_strings->end(),
|
||||
*(o->reST_doc_strings));
|
||||
}
|
||||
|
||||
delete o;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue