mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/type-alias-introspection'
* origin/topic/jsiwek/type-alias-introspection: Add enum_names() BIF to return names of an enum type's values Add type_aliases() BIF for introspecting type-names of types/values Change Type::type_aliases map to store IntrusivePtr Fix lookup_ID() BIF to return enum values
This commit is contained in:
commit
aab99b743d
12 changed files with 301 additions and 13 deletions
|
@ -171,7 +171,7 @@ static void parser_redef_enum (zeek::detail::ID *id)
|
|||
static void extend_record(zeek::detail::ID* id, std::unique_ptr<zeek::type_decl_list> fields,
|
||||
std::unique_ptr<std::vector<zeek::detail::AttrPtr>> attrs)
|
||||
{
|
||||
std::set<zeek::Type*> types = zeek::Type::GetAliases(id->Name());
|
||||
const auto& types = zeek::Type::Aliases(id->Name());
|
||||
|
||||
if ( types.empty() )
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ static void extend_record(zeek::detail::ID* id, std::unique_ptr<zeek::type_decl_
|
|||
break;
|
||||
}
|
||||
|
||||
for ( auto t : types )
|
||||
for ( const auto& t : types )
|
||||
{
|
||||
auto error = t->AsRecordType()->AddFields(*fields, add_log_attr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue