mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
captures for "when" statements
update Triggers to IntrusivePtr's and simpler AST traversal introduce IDSet type, migrate associated "ID*" types to "const ID*"
This commit is contained in:
parent
fa142438fe
commit
f895008c34
24 changed files with 648 additions and 202 deletions
|
@ -910,12 +910,19 @@ StmtPtr InitStmt::DoReduce(Reducer* c)
|
|||
|
||||
StmtPtr WhenStmt::Duplicate()
|
||||
{
|
||||
auto cond_d = cond->Duplicate();
|
||||
auto s1_d = s1->Duplicate();
|
||||
auto s2_d = s2 ? s2->Duplicate() : nullptr;
|
||||
auto timeout_d = timeout ? timeout->Duplicate() : nullptr;
|
||||
FuncType::CaptureList* cl_dup = nullptr;
|
||||
|
||||
return SetSucc(new WhenStmt(cond_d, s1_d, s2_d, timeout_d, is_return));
|
||||
if ( wi->Captures() )
|
||||
{
|
||||
cl_dup = new FuncType::CaptureList;
|
||||
*cl_dup = *wi->Captures();
|
||||
}
|
||||
|
||||
auto new_wi = new WhenInfo(Cond(), cl_dup, IsReturn());
|
||||
new_wi->AddBody(Body());
|
||||
new_wi->AddTimeout(TimeoutExpr(), TimeoutBody());
|
||||
|
||||
return SetSucc(new WhenStmt(wi));
|
||||
}
|
||||
|
||||
void WhenStmt::Inline(Inliner* inl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue