mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Revising format of initialization values in generated script docs.
Fixed the obvious things: reduced the space taken up by empty tables and allowed record values to span multiple lines (one for each record field).
This commit is contained in:
parent
2d17ca0942
commit
758172120b
3 changed files with 59 additions and 19 deletions
28
src/ID.cc
28
src/ID.cc
|
@ -681,20 +681,30 @@ void ID::DescribeReST(ODesc* d, bool is_role) const
|
|||
type->Tag() != TYPE_FUNC &&
|
||||
type->InternalType() != TYPE_INTERNAL_VOID )
|
||||
{
|
||||
d->Add(":Default:");
|
||||
if ( type->InternalType() == TYPE_INTERNAL_OTHER )
|
||||
{
|
||||
d->Add(":Init:");
|
||||
d->NL();
|
||||
d->NL();
|
||||
d->Add("::");
|
||||
d->NL();
|
||||
d->PushIndent();
|
||||
val->DescribeReST(d);
|
||||
d->PopIndent();
|
||||
switch ( type->Tag() ) {
|
||||
case TYPE_TABLE:
|
||||
if ( val->AsTable()->Length() == 0 )
|
||||
{
|
||||
d->Add(" ``{}``");
|
||||
d->NL();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
d->NL();
|
||||
d->NL();
|
||||
d->Add("::");
|
||||
d->NL();
|
||||
d->PushIndent();
|
||||
val->DescribeReST(d);
|
||||
d->PopIndent();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
d->Add(":Init: ");
|
||||
d->SP();
|
||||
val->DescribeReST(d);
|
||||
d->NL();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue