mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Merge remote-tracking branch 'origin/topic/johanna/bit-1976'
* origin/topic/johanna/bit-1976: Allow event/function definitions to be wrapped in directives. Fixed to work with attributes (e.g. &priority).
This commit is contained in:
commit
611c00a605
10 changed files with 126 additions and 37 deletions
15
src/Scope.cc
15
src/Scope.cc
|
@ -11,9 +11,10 @@ static scope_list scopes;
|
|||
static Scope* top_scope;
|
||||
|
||||
|
||||
Scope::Scope(ID* id)
|
||||
Scope::Scope(ID* id, attr_list* al)
|
||||
{
|
||||
scope_id = id;
|
||||
attrs = al;
|
||||
return_type = 0;
|
||||
|
||||
local = new PDict(ID)(ORDERED);
|
||||
|
@ -42,6 +43,14 @@ Scope::~Scope()
|
|||
for ( int i = 0; i < local->Length(); ++i )
|
||||
Unref(local->NthEntry(i));
|
||||
|
||||
if ( attrs )
|
||||
{
|
||||
loop_over_list(*attrs, i)
|
||||
Unref((*attrs)[i]);
|
||||
|
||||
delete attrs;
|
||||
}
|
||||
|
||||
Unref(scope_id);
|
||||
Unref(return_type);
|
||||
delete local;
|
||||
|
@ -186,9 +195,9 @@ void push_existing_scope(Scope* scope)
|
|||
scopes.append(scope);
|
||||
}
|
||||
|
||||
void push_scope(ID* id)
|
||||
void push_scope(ID* id, attr_list* attrs)
|
||||
{
|
||||
top_scope = new Scope(id);
|
||||
top_scope = new Scope(id, attrs);
|
||||
scopes.append(top_scope);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue