Clarified Node documentation.

Fixed a bug that caused errors when loading documents with YAML
version directives.
This commit is contained in:
Ferdinand Majerech 2011-10-20 20:01:52 +02:00
parent a87d618732
commit d5a063930d
2 changed files with 6 additions and 1 deletions

View file

@ -205,6 +205,11 @@ struct Loader
/** /**
* Load all YAML documents. * Load all YAML documents.
*
* This is just a shortcut that iterates over all documents and returns
* them all at once. Calling loadAll after iterating over the node or
* vice versa will not return any documents, as they have all been parsed
* already.
* *
* Returns: Array of root nodes of all documents in the file/stream. * Returns: Array of root nodes of all documents in the file/stream.
* *

View file

@ -351,7 +351,7 @@ final class Parser
enforce(YAMLVersion_ is null, enforce(YAMLVersion_ is null,
new Error("Duplicate YAML directive", token.startMark)); new Error("Duplicate YAML directive", token.startMark));
const minor = parts[1].split(".")[0]; const minor = parts[1].split(".")[0];
enforce(to!int(minor) == 1, enforce(minor == "1",
new Error("Incompatible document (version 1.x is required)", new Error("Incompatible document (version 1.x is required)",
token.startMark)); token.startMark));
YAMLVersion_ = parts[1]; YAMLVersion_ = parts[1];