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:
Tim Wojtulewicz 2020-04-13 14:59:50 -07:00
commit ba1c03188f
24 changed files with 715 additions and 16 deletions

View file

@ -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();
}