mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
logic (other than in profiling) for assignments that yield separate values
This commit is contained in:
parent
e22d279fdf
commit
fa142438fe
3 changed files with 39 additions and 2 deletions
|
@ -959,6 +959,15 @@ public:
|
|||
bool IsTemp() const { return is_temp; }
|
||||
void SetIsTemp() { is_temp = true; }
|
||||
|
||||
// The following is a hack that's used in "when" expressions to support
|
||||
// assignments to new locals, like "when ( (local l = foo()) && ...".
|
||||
// These methods return the value to use when evaluating such
|
||||
// assignments. That would normally be the RHS of the assignment,
|
||||
// but to get when's to work in a convenient fashion, for them it's
|
||||
// instead boolean T.
|
||||
ValPtr AssignVal() { return val; }
|
||||
const ValPtr& AssignVal() const { return val; }
|
||||
|
||||
protected:
|
||||
bool TypeCheck(const AttributesPtr& attrs = nullptr);
|
||||
bool TypeCheckArithmetics(TypeTag bt1, TypeTag bt2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue