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:
Vern Paxson 2022-01-07 14:50:35 -08:00
parent fa142438fe
commit f895008c34
24 changed files with 648 additions and 202 deletions

View file

@ -137,6 +137,7 @@ using EventExprPtr = IntrusivePtr<EventExpr>;
using ExprPtr = IntrusivePtr<Expr>;
using NameExprPtr = IntrusivePtr<NameExpr>;
using RefExprPtr = IntrusivePtr<RefExpr>;
using LambdaExprPtr = IntrusivePtr<LambdaExpr>;
class Stmt;
using StmtPtr = IntrusivePtr<Stmt>;
@ -1428,7 +1429,8 @@ protected:
class LambdaExpr final : public Expr
{
public:
LambdaExpr(std::unique_ptr<function_ingredients> ingredients, IDPList outer_ids);
LambdaExpr(std::unique_ptr<function_ingredients> ingredients, IDPList outer_ids,
StmtPtr when_parent = nullptr);
const std::string& Name() const { return my_name; }
const IDPList& OuterIDs() const { return outer_ids; }
@ -1449,7 +1451,7 @@ protected:
void ExprDescribe(ODesc* d) const override;
private:
void CheckCaptures();
void CheckCaptures(StmtPtr when_parent);
std::unique_ptr<function_ingredients> ingredients;