Clarified Node documentation.
Fixed a bug that caused errors when loading documents with YAML version directives.
This commit is contained in:
parent
a87d618732
commit
d5a063930d
|
@ -206,6 +206,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.
|
||||||
*
|
*
|
||||||
* Throws: YAMLException on a parsing error.
|
* Throws: YAMLException on a parsing error.
|
||||||
|
|
|
@ -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];
|
||||||
|
|
Loading…
Reference in a new issue