mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Add key-value for loop
This commit is contained in:
parent
a36ac12e88
commit
1f7924754e
7 changed files with 145 additions and 6 deletions
|
@ -337,6 +337,8 @@ protected:
|
|||
class ForStmt : public ExprStmt {
|
||||
public:
|
||||
ForStmt(id_list* loop_vars, Expr* loop_expr);
|
||||
// Special constructor for key value for loop.
|
||||
ForStmt(id_list* loop_vars, Expr* loop_expr, ID* val_var);
|
||||
~ForStmt() override;
|
||||
|
||||
void AddBody(Stmt* arg_body) { body = arg_body; }
|
||||
|
@ -361,6 +363,9 @@ protected:
|
|||
|
||||
id_list* loop_vars;
|
||||
Stmt* body;
|
||||
// Stores the value variable being used for a key value for loop.
|
||||
// Always set to nullptr unless special constructor is called.
|
||||
ID* value_var = nullptr;
|
||||
};
|
||||
|
||||
class NextStmt : public Stmt {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue