mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Fix CommentedTypeDecl to track whether it's in a record like TypeDecl does.
This commit is contained in:
parent
da5618b9ba
commit
70e14cb7d5
4 changed files with 14 additions and 4 deletions
|
@ -848,8 +848,8 @@ void TypeDecl::DescribeReST(ODesc* d) const
|
||||||
}
|
}
|
||||||
|
|
||||||
CommentedTypeDecl::CommentedTypeDecl(BroType* t, const char* i,
|
CommentedTypeDecl::CommentedTypeDecl(BroType* t, const char* i,
|
||||||
attr_list* attrs, std::list<std::string>* cmnt_list)
|
attr_list* attrs, bool in_record, std::list<std::string>* cmnt_list)
|
||||||
: TypeDecl(t, i, attrs)
|
: TypeDecl(t, i, attrs, in_record)
|
||||||
{
|
{
|
||||||
comments = cmnt_list;
|
comments = cmnt_list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -420,7 +420,7 @@ public:
|
||||||
class CommentedTypeDecl : public TypeDecl {
|
class CommentedTypeDecl : public TypeDecl {
|
||||||
public:
|
public:
|
||||||
CommentedTypeDecl(BroType* t, const char* i, attr_list* attrs = 0,
|
CommentedTypeDecl(BroType* t, const char* i, attr_list* attrs = 0,
|
||||||
std::list<std::string>* cmnt_list = 0);
|
bool in_record = false, std::list<std::string>* cmnt_list = 0);
|
||||||
virtual ~CommentedTypeDecl();
|
virtual ~CommentedTypeDecl();
|
||||||
|
|
||||||
void DescribeReST(ODesc* d) const;
|
void DescribeReST(ODesc* d) const;
|
||||||
|
|
|
@ -936,6 +936,7 @@ type_decl:
|
||||||
|
|
||||||
if ( generate_documentation )
|
if ( generate_documentation )
|
||||||
{
|
{
|
||||||
|
// TypeDecl ctor deletes the attr list, so make a copy
|
||||||
attr_list* a = $5;
|
attr_list* a = $5;
|
||||||
attr_list* a_copy = 0;
|
attr_list* a_copy = 0;
|
||||||
|
|
||||||
|
@ -947,7 +948,7 @@ type_decl:
|
||||||
}
|
}
|
||||||
|
|
||||||
last_fake_type_decl = new CommentedTypeDecl(
|
last_fake_type_decl = new CommentedTypeDecl(
|
||||||
$4, $2, a_copy, concat_opt_docs($1, $7));
|
$4, $2, a_copy, (in_record > 0), concat_opt_docs($1, $7));
|
||||||
}
|
}
|
||||||
|
|
||||||
$$ = new TypeDecl($4, $2, $5, (in_record > 0));
|
$$ = new TypeDecl($4, $2, $5, (in_record > 0));
|
||||||
|
|
9
testing/btest/doc/record-attr-check.bro
Normal file
9
testing/btest/doc/record-attr-check.bro
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# @TEST-EXEC: bro --doc-scripts %INPUT
|
||||||
|
|
||||||
|
type Tag: enum {
|
||||||
|
SOMETHING
|
||||||
|
};
|
||||||
|
|
||||||
|
type R: record {
|
||||||
|
field1: set[Tag] &default=set();
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue