mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
make externally available the expression used for initializating a record field
This commit is contained in:
parent
88ef6cb5b6
commit
9fe7d8581f
2 changed files with 10 additions and 1 deletions
|
@ -854,6 +854,8 @@ void TypeDecl::DescribeReST(ODesc* d, bool roles_only) const {
|
|||
|
||||
namespace detail {
|
||||
|
||||
ExprPtr FieldInit::InitExpr() const { return nullptr; }
|
||||
|
||||
// A record field initialization that directly assigns a fixed value ...
|
||||
class DirectFieldInit final : public FieldInit {
|
||||
public:
|
||||
|
@ -884,7 +886,7 @@ private:
|
|||
class ExprFieldInit final : public FieldInit {
|
||||
public:
|
||||
// Initialization requires evaluating the given expression,
|
||||
// yielding the a value of the given type (which might require
|
||||
// yielding a value of the given type (which might require
|
||||
// coercion for some records).
|
||||
ExprFieldInit(detail::ExprPtr _init_expr, TypePtr _init_type)
|
||||
: init_expr(std::move(_init_expr)), init_type(std::move(_init_type)) {
|
||||
|
@ -910,6 +912,8 @@ public:
|
|||
|
||||
bool IsDeferrable() const override { return false; }
|
||||
|
||||
ExprPtr InitExpr() const override { return init_expr; }
|
||||
|
||||
private:
|
||||
detail::ExprPtr init_expr;
|
||||
TypePtr init_type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue