update examples so they can compile again, and make them visible to dub

This commit is contained in:
Cameron Ross 2018-04-27 00:17:09 -03:00 committed by Petar Kirov
parent b44f96bd9f
commit 4680e1b5b2
15 changed files with 57 additions and 54 deletions

View file

@ -5,6 +5,6 @@
"mainSourceFile": "yaml_stats.d",
"dependencies":
{
"dyaml": { "version" : "~>0.5.0" },
},
"dyaml": { "version" : "*" }
}
}

View file

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