mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
global_ids(): Include module names
Ad-hoc include module names in the global_ids() table. Table values will have the type_name field set to "module" and their key in the table is prefixed with "module " to avoid clashes with existing global identifiers shadowing module names (Management::Node being an existing example). Closes #3136
This commit is contained in:
parent
f6f9dd2620
commit
4cde1c3c3f
8 changed files with 85 additions and 12 deletions
12
src/Var.cc
12
src/Var.cc
|
@ -470,6 +470,18 @@ void add_type(ID* id, TypePtr t, std::unique_ptr<std::vector<AttrPtr>> attr)
|
|||
id->SetAttrs(make_intrusive<Attributes>(std::move(*attr), tnew, false, false));
|
||||
}
|
||||
|
||||
static std::set<std::string> all_module_names;
|
||||
|
||||
void add_module(const char* module_name)
|
||||
{
|
||||
all_module_names.emplace(module_name);
|
||||
}
|
||||
|
||||
const std::set<std::string>& module_names()
|
||||
{
|
||||
return all_module_names;
|
||||
}
|
||||
|
||||
static void transfer_arg_defaults(RecordType* args, RecordType* recv)
|
||||
{
|
||||
for ( int i = 0; i < args->NumFields(); ++i )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue