mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/alternate-hook-event-prototypes'
* origin/topic/jsiwek/alternate-hook-event-prototypes: Add warning for ineffective &default arguments in handlers Fix frame size allocation of alternate event/hook handlers Emit error for alternate event/hook prototype args with attributes Improve alternate event/hook prototype matching Allow alternate event/hook prototype declarations
This commit is contained in:
commit
ba1c03188f
24 changed files with 715 additions and 16 deletions
34
src/ID.cc
34
src/ID.cc
|
@ -431,8 +431,42 @@ void ID::DescribeReST(ODesc* d, bool roles_only) const
|
|||
d->Add("`");
|
||||
}
|
||||
else
|
||||
{
|
||||
type->DescribeReST(d, roles_only);
|
||||
|
||||
if ( IsFunc(type->Tag()) )
|
||||
{
|
||||
auto ft = type->AsFuncType();
|
||||
|
||||
if ( ft->Flavor() == FUNC_FLAVOR_EVENT ||
|
||||
ft->Flavor() == FUNC_FLAVOR_HOOK )
|
||||
{
|
||||
const auto& protos = ft->Prototypes();
|
||||
|
||||
if ( protos.size() > 1 )
|
||||
{
|
||||
auto first = true;
|
||||
|
||||
for ( const auto& proto : protos )
|
||||
{
|
||||
if ( first )
|
||||
{
|
||||
first = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
d->NL();
|
||||
d->Add(":Type: :zeek:type:`");
|
||||
d->Add(ft->FlavorString());
|
||||
d->Add("` (");
|
||||
proto.args->DescribeFieldsReST(d, true);
|
||||
d->Add(")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
d->NL();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue