mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Fixes for declared type ID tracking & adding DescribeReST()'s
Changed BroType to track a char* instead of an ID* that represents the declared type's identifier. It was also necessary to serialize this information or else it can be lost (e.g. FieldDecl's in RecordType always seem to get serialized at some point). DescribeReST() functions added to many classes to get the output closer to being reST compatible; still needs tweaking for Sphinx (reST->HTML) compatibility.
This commit is contained in:
parent
287a3a3cb8
commit
15fd5297a3
10 changed files with 214 additions and 6 deletions
35
src/ID.cc
35
src/ID.cc
|
@ -607,6 +607,41 @@ void ID::DescribeExtended(ODesc* d) const
|
|||
}
|
||||
}
|
||||
|
||||
void ID::DescribeReST(ODesc* d) const
|
||||
{
|
||||
d->Add(".. bro:id:: ");
|
||||
d->Add(name);
|
||||
d->PushIndent();
|
||||
|
||||
if ( type )
|
||||
{
|
||||
d->Add(".. bro:type:: ");
|
||||
if ( ! is_type && type->GetTypeID() )
|
||||
{
|
||||
d->Add("`");
|
||||
d->Add(type->GetTypeID());
|
||||
d->Add("`");
|
||||
}
|
||||
else
|
||||
type->DescribeReST(d);
|
||||
}
|
||||
|
||||
if ( attrs )
|
||||
{
|
||||
attrs->DescribeReST(d);
|
||||
}
|
||||
|
||||
if ( val && type &&
|
||||
type->InternalType() != TYPE_INTERNAL_OTHER &&
|
||||
type->InternalType() != TYPE_INTERNAL_VOID )
|
||||
{
|
||||
d->NL();
|
||||
d->Add(".. bro:val:: ");
|
||||
val->DescribeReST(d);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void ID::UpdateValID()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue