mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +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
10
src/Type.cc
10
src/Type.cc
|
@ -1348,13 +1348,11 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
|
|||
if ( vals.find(val) == vals.end() )
|
||||
vals[val] = make_intrusive<EnumVal>(IntrusivePtr{NewRef{}, this}, val);
|
||||
|
||||
set<Type*> types = Type::GetAliases(GetName());
|
||||
set<Type*>::const_iterator it;
|
||||
const auto& types = Type::Aliases(GetName());
|
||||
|
||||
for ( it = types.begin(); it != types.end(); ++it )
|
||||
if ( *it != this )
|
||||
(*it)->AsEnumType()->AddNameInternal(module_name, name, val,
|
||||
is_export);
|
||||
for ( const auto& t : types )
|
||||
if ( t.get() != this )
|
||||
t->AsEnumType()->AddNameInternal(module_name, name, val, is_export);
|
||||
}
|
||||
|
||||
void EnumType::AddNameInternal(const string& module_name, const char* name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue