mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Allow named table constructors. Addresses #983.
This commit is contained in:
parent
29740d3d6e
commit
bcf5c41786
5 changed files with 117 additions and 14 deletions
15
src/Expr.h
15
src/Expr.h
|
@ -58,6 +58,7 @@ class Stmt;
|
|||
class Frame;
|
||||
class ListExpr;
|
||||
class NameExpr;
|
||||
class AssignExpr;
|
||||
class CallExpr;
|
||||
class EventExpr;
|
||||
|
||||
|
@ -177,6 +178,17 @@ public:
|
|||
return (NameExpr*) this;
|
||||
}
|
||||
|
||||
const AssignExpr* AsAssignExpr() const
|
||||
{
|
||||
CHECK_TAG(tag, EXPR_ASSIGN, "ExprVal::AsAssignExpr", expr_name)
|
||||
return (const AssignExpr*) this;
|
||||
}
|
||||
AssignExpr* AsAssignExpr()
|
||||
{
|
||||
CHECK_TAG(tag, EXPR_ASSIGN, "ExprVal::AsAssignExpr", expr_name)
|
||||
return (AssignExpr*) this;
|
||||
}
|
||||
|
||||
void Describe(ODesc* d) const;
|
||||
|
||||
bool Serialize(SerialInfo* info) const;
|
||||
|
@ -760,7 +772,8 @@ protected:
|
|||
|
||||
class TableConstructorExpr : public UnaryExpr {
|
||||
public:
|
||||
TableConstructorExpr(ListExpr* constructor_list, attr_list* attrs);
|
||||
TableConstructorExpr(ListExpr* constructor_list, attr_list* attrs,
|
||||
BroType* arg_type = 0);
|
||||
~TableConstructorExpr() { Unref(attrs); }
|
||||
|
||||
Attributes* Attrs() { return attrs; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue