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

@ -7,5 +7,14 @@
"license": "Boost 1.0", "license": "Boost 1.0",
"dependencies": { "tinyendian" : { "version" : "~>0.1.0" } }, "dependencies": { "tinyendian" : { "version" : "~>0.1.0" } },
"homepage": "https://github.com/dlang-community/D-YAML", "homepage": "https://github.com/dlang-community/D-YAML",
"copyright": "Copyright © 2011-2014, Ferdinand Majerech" "copyright": "Copyright © 2011-2014, Ferdinand Majerech",
"subPackages": [
"examples/constructor",
"examples/getting_started",
"examples/representer",
"examples/resolver",
"examples/yaml_bench",
"examples/yaml_gen",
"examples/yaml_stats"
]
} }

View file

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

View file

@ -1,6 +1,6 @@
import std.stdio; import std.stdio;
import std.string; import std.string;
import dyaml.all; import dyaml;
struct Color struct Color
{ {

View file

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

View file

@ -1,5 +1,5 @@
import std.stdio; import std.stdio;
import dyaml.all; import dyaml;
void main() void main()
{ {

View file

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

View file

@ -1,5 +1,5 @@
import std.stdio; import std.stdio;
import dyaml.all; import dyaml;
struct Color struct Color
{ {
@ -16,7 +16,7 @@ struct Color
} }
} }
Node representColor(ref Node node, Representer representer) Node representColor(ref Node node, Representer representer) @safe
{ {
//The node is guaranteed to be Color as we add representer for Color. //The node is guaranteed to be Color as we add representer for Color.
Color color = node.as!Color; Color color = node.as!Color;

View file

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

View file

@ -1,6 +1,6 @@
import std.stdio; import std.stdio;
import std.string; import std.string;
import dyaml.all; import dyaml;
struct Color struct Color
{ {

View file

@ -1,16 +1,10 @@
{ {
"name": "yaml_bench", "name": "benchmark",
"targetType": "executable", "targetType": "executable",
"sourceFiles": ["yaml_bench.d"], "sourceFiles": ["yaml_bench.d"],
"mainSourceFile": "yaml_bench.d", "mainSourceFile": "yaml_bench.d",
"dependencies": "dependencies":
{ {
"dyaml": { "version" : "~>0.5.0" }, "dyaml": { "version" : "*" }
},
"buildTypes":
{
"debug": { "buildOptions": ["debugMode", "debugInfoC"] },
"release": { "buildOptions": ["releaseMode", "optimize", "inline", "noBoundsCheck"] },
"profile": { "buildOptions": ["releaseMode", "optimize", "noBoundsCheck", "debugInfoC"] }
} }
} }

View file

@ -6,27 +6,27 @@ import std.conv;
import std.datetime; import std.datetime;
import std.stdio; import std.stdio;
import std.string; import std.string;
import dyaml.all; import dyaml;
///Print help information. ///Print help information.
void help() void help()
{ {
string help = string help =
"D:YAML benchmark\n" "D:YAML benchmark\n"~
"Copyright (C) 2011-2014 Ferdinand Majerech\n" "Copyright (C) 2011-2014 Ferdinand Majerech\n"~
"Usage: yaml_bench [OPTION ...] [YAML_FILE]\n" "Usage: yaml_bench [OPTION ...] [YAML_FILE]\n"~
"\n" "\n"~
"Loads and optionally extracts data and/or dumps a YAML file.\n" "Loads and optionally extracts data and/or dumps a YAML file.\n"~
"\n" "\n"~
"Available options:\n" "Available options:\n"~
" -h --help Show this help information.\n" " -h --help Show this help information.\n"~
" -g --get Extract data from the file (using Node.as()).\n" " -g --get Extract data from the file (using Node.as()).\n"~
" -d --dump Dump the loaded data (to YAML_FILE.dump).\n" " -d --dump Dump the loaded data (to YAML_FILE.dump).\n"~
" -r --runs=NUM Repeat parsing the file NUM times.\n" " -r --runs=NUM Repeat parsing the file NUM times.\n"~
" --reload Reload the file from the diskl on every repeat\n" " --reload Reload the file from the diskl on every repeat\n"~
" By default, the file is loaded to memory once\n" " By default, the file is loaded to memory once\n"~
" and repeatedly parsed from memory.\n" " and repeatedly parsed from memory.\n"~
" -s --scan-only Do not execute the entire parsing process, only\n" " -s --scan-only Do not execute the entire parsing process, only\n"~
" scanning. Overrides '--dump'.\n"; " scanning. Overrides '--dump'.\n";
writeln(help); writeln(help);
} }

View file

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

View file

@ -8,7 +8,7 @@ import std.math;
import std.random; import std.random;
import std.stdio; import std.stdio;
import std.string; import std.string;
import dyaml.all; import dyaml;
Node config; Node config;

View file

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

View file

@ -3,7 +3,7 @@
import std.stdio; import std.stdio;
import std.string; import std.string;
import dyaml.all; import dyaml;
///Collects statistics about a YAML document and returns them as string. ///Collects statistics about a YAML document and returns them as string.