update examples so they can compile again, and make them visible to dub
This commit is contained in:
parent
b44f96bd9f
commit
4680e1b5b2
15 changed files with 57 additions and 54 deletions
|
@ -5,6 +5,6 @@
|
|||
"mainSourceFile": "yaml_stats.d",
|
||||
"dependencies":
|
||||
{
|
||||
"dyaml": { "version" : "~>0.5.0" },
|
||||
},
|
||||
"dyaml": { "version" : "*" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import std.stdio;
|
||||
import std.string;
|
||||
import dyaml.all;
|
||||
import dyaml;
|
||||
|
||||
|
||||
///Collects statistics about a YAML document and returns them as string.
|
||||
|
@ -66,8 +66,8 @@ string statistics(ref Node document)
|
|||
"\nMappings: %s" ~
|
||||
"\n\nAverage sequence length: %s" ~
|
||||
"\nAverage mapping length: %s" ~
|
||||
"\n\n%s",
|
||||
nodes, scalars, sequences, mappings,
|
||||
"\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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue