mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Switch parsing to use vector<IntrusivePtr<Attr>> from attr_list
This allows improved passing/storing of Attr references to Exprs, TypeDecl, Scope, etc.
This commit is contained in:
parent
ce6f69cd19
commit
8b6de5852c
10 changed files with 194 additions and 239 deletions
11
src/Type.h
11
src/Type.h
|
@ -562,7 +562,8 @@ protected:
|
|||
|
||||
class TypeDecl final {
|
||||
public:
|
||||
TypeDecl(IntrusivePtr<BroType> t, const char* i, attr_list* attrs = nullptr, bool in_record = false);
|
||||
TypeDecl() = default;
|
||||
TypeDecl(const char* i, IntrusivePtr<BroType> t, IntrusivePtr<Attributes> attrs = nullptr);
|
||||
TypeDecl(const TypeDecl& other);
|
||||
~TypeDecl();
|
||||
|
||||
|
@ -577,7 +578,7 @@ public:
|
|||
|
||||
IntrusivePtr<BroType> type;
|
||||
IntrusivePtr<Attributes> attrs;
|
||||
const char* id;
|
||||
const char* id = nullptr;
|
||||
};
|
||||
|
||||
typedef PList<TypeDecl> type_decl_list;
|
||||
|
@ -656,9 +657,9 @@ public:
|
|||
*/
|
||||
IntrusivePtr<TableVal> GetRecordFieldsVal(const RecordVal* rv = nullptr) const;
|
||||
|
||||
// Returns 0 if all is ok, otherwise a pointer to an error message.
|
||||
// Takes ownership of list.
|
||||
const char* AddFields(type_decl_list* types, attr_list* attr);
|
||||
// Returns null if all is ok, otherwise a pointer to an error message.
|
||||
const char* AddFields(const type_decl_list& types,
|
||||
bool add_log_attr = false);
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue