Initial commit.
This commit is contained in:
commit
283c42bf8f
592 changed files with 26392 additions and 0 deletions
2
examples/getting_started/Makefile
Normal file
2
examples/getting_started/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
main:
|
||||
dmd -w -I../../ -L-L../../ -L-ldyaml main.d
|
4
examples/getting_started/input.yaml
Normal file
4
examples/getting_started/input.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
Hello World :
|
||||
- Hello
|
||||
- World
|
||||
Answer : 42
|
12
examples/getting_started/main.d
Normal file
12
examples/getting_started/main.d
Normal file
|
@ -0,0 +1,12 @@
|
|||
import std.stdio;
|
||||
import yaml;
|
||||
|
||||
void main()
|
||||
{
|
||||
yaml.Node root = yaml.load("input.yaml");
|
||||
foreach(string word; root["Hello World"])
|
||||
{
|
||||
writeln(word);
|
||||
}
|
||||
writeln("The answer is ", root["Answer"].get!int);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue