yaml_stats example DMD 2.061 compatibility.
This commit is contained in:
parent
539f5837d6
commit
3f75b57b9e
|
@ -57,16 +57,20 @@ string statistics(ref Node document)
|
||||||
string tagStats = "\nTag statistics:\n";
|
string tagStats = "\nTag statistics:\n";
|
||||||
foreach(tag, count; tags)
|
foreach(tag, count; tags)
|
||||||
{
|
{
|
||||||
tagStats ~= format("\n", tag, " : ", count);
|
tagStats ~= format("\n%s : %s", tag, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
return format( "\nNodes: ", nodes,
|
return format( "\nNodes: %s" ~
|
||||||
"\n\nScalars: ", scalars,
|
"\n\nScalars: %s" ~
|
||||||
"\nSequences: ", sequences,
|
"\nSequences: %s" ~
|
||||||
"\nMappings: ", mappings,
|
"\nMappings: %s" ~
|
||||||
"\n\nAverage sequence length: ", cast(real)seqItems / sequences,
|
"\n\nAverage sequence length: %s" ~
|
||||||
"\nAverage mapping length: ", cast(real)mapPairs / mappings,
|
"\nAverage mapping length: %s" ~
|
||||||
"\n\n", tagStats);
|
"\n\n%s",
|
||||||
|
nodes, scalars, sequences, mappings,
|
||||||
|
sequences == 0.0 ? 0.0 : cast(real)seqItems / sequences,
|
||||||
|
mappings == 0.0 ? 0.0 : cast(real)mapPairs / mappings,
|
||||||
|
tagStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main(string[] args)
|
void main(string[] args)
|
||||||
|
|
Loading…
Reference in a new issue