Loader whitespace fixes.

This commit is contained in:
Ferdinand Majerech 2014-07-19 14:38:35 +02:00
parent d2fe876316
commit a50907b0bd

View file

@ -112,7 +112,7 @@ struct Loader
this(string filename) @trusted this(string filename) @trusted
{ {
name_ = filename; name_ = filename;
try{this(new File(filename));} try { this(new File(filename)); }
catch(StreamException e) catch(StreamException e)
{ {
throw new YAMLException("Unable to open file " ~ filename ~ throw new YAMLException("Unable to open file " ~ filename ~
@ -201,7 +201,7 @@ struct Loader
{ {
try try
{ {
scope(exit){done_ = true;} scope(exit) { done_ = true; }
auto composer = new Composer(parser_, resolver_, constructor_); auto composer = new Composer(parser_, resolver_, constructor_);
enforce(composer.checkNode(), new YAMLException("No YAML document to load")); enforce(composer.checkNode(), new YAMLException("No YAML document to load"));
return composer.getSingleNode(); return composer.getSingleNode();
@ -228,7 +228,7 @@ struct Loader
Node[] loadAll() @safe Node[] loadAll() @safe
{ {
Node[] nodes; Node[] nodes;
foreach(ref node; this){nodes ~= node;} foreach(ref node; this) {nodes ~= node;}
return nodes; return nodes;
} }
@ -246,7 +246,7 @@ struct Loader
} }
body body
{ {
scope(exit){done_ = true;} scope(exit) { done_ = true; }
try try
{ {
auto composer = new Composer(parser_, resolver_, constructor_); auto composer = new Composer(parser_, resolver_, constructor_);
@ -256,7 +256,7 @@ struct Loader
{ {
auto node = composer.getNode(); auto node = composer.getNode();
result = dg(node); result = dg(node);
if(result){break;} if(result) { break; }
} }
return result; return result;
@ -275,7 +275,10 @@ struct Loader
try try
{ {
Token[] result; Token[] result;
while(scanner_.checkToken()){result ~= scanner_.getToken();} while(scanner_.checkToken())
{
result ~= scanner_.getToken();
}
return result; return result;
} }
catch(YAMLException e) catch(YAMLException e)
@ -291,7 +294,10 @@ struct Loader
try try
{ {
immutable(Event)[] result; immutable(Event)[] result;
while(parser_.checkEvent()){result ~= parser_.getEvent();} while(parser_.checkEvent())
{
result ~= parser_.getEvent();
}
return result; return result;
} }
catch(YAMLException e) catch(YAMLException e)