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:
Jon Siwek 2011-04-01 15:21:15 -05:00
parent 2d17ca0942
commit 758172120b
3 changed files with 59 additions and 19 deletions

View file

@ -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();
}