mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
tabify
This commit is contained in:
parent
a0fa5758a6
commit
bb8d6bca67
1 changed files with 27 additions and 29 deletions
56
src/Type.cc
56
src/Type.cc
|
@ -847,36 +847,34 @@ TableVal* RecordType::GetRecordFieldsVal(const RecordVal* rv) const
|
||||||
if ( ft->Tag() == TYPE_RECORD )
|
if ( ft->Tag() == TYPE_RECORD )
|
||||||
nr->Assign(0, new StringVal("record " + ft->GetName()));
|
nr->Assign(0, new StringVal("record " + ft->GetName()));
|
||||||
else if ( ft->Tag() == TYPE_VECTOR )
|
else if ( ft->Tag() == TYPE_VECTOR )
|
||||||
{
|
{
|
||||||
string s = "vector[";
|
string s = fmt("vector of %s", ft->YieldType()->Tag());
|
||||||
s += type_name(ft->YieldType()->Tag());
|
nr->Assign(0, new StringVal(s));
|
||||||
s += "]";
|
}
|
||||||
nr->Assign(0, new StringVal(s));
|
|
||||||
}
|
|
||||||
else if ( ft->Tag() == TYPE_TABLE )
|
else if ( ft->Tag() == TYPE_TABLE )
|
||||||
{
|
{
|
||||||
string s;
|
string s;
|
||||||
if ( ft->IsSet() )
|
if ( ft->IsSet() )
|
||||||
s = "set[";
|
s = "set[";
|
||||||
else
|
else
|
||||||
s = "table[";
|
s = "table[";
|
||||||
const type_list* tl = ((const IndexType*) ft)->IndexTypes();
|
const type_list* tl = ((const IndexType*) ft)->IndexTypes();
|
||||||
loop_over_list(*tl, i)
|
loop_over_list(*tl, i)
|
||||||
{
|
{
|
||||||
if ( i > 0 )
|
if ( i > 0 )
|
||||||
s += ",";
|
s += ",";
|
||||||
s += type_name((*tl)[i]->Tag());
|
s += type_name((*tl)[i]->Tag());
|
||||||
}
|
}
|
||||||
s += "]";
|
s += "]";
|
||||||
if ( ft->YieldType() )
|
if ( ft->YieldType() )
|
||||||
{
|
{
|
||||||
s += " of ";
|
s += " of ";
|
||||||
s += type_name(ft->YieldType()->Tag());
|
s += type_name(ft->YieldType()->Tag());
|
||||||
}
|
}
|
||||||
nr->Assign(0, new StringVal(s));
|
nr->Assign(0, new StringVal(s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
nr->Assign(0, new StringVal(type_name(ft->Tag())));
|
nr->Assign(0, new StringVal(type_name(ft->Tag())));
|
||||||
|
|
||||||
nr->Assign(1, val_mgr->GetBool(logged));
|
nr->Assign(1, val_mgr->GetBool(logged));
|
||||||
nr->Assign(2, fv);
|
nr->Assign(2, fv);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue