diff --git a/dyaml/loader.d b/dyaml/loader.d index b173e19..112285a 100644 --- a/dyaml/loader.d +++ b/dyaml/loader.d @@ -205,6 +205,11 @@ struct Loader /** * 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. * diff --git a/dyaml/parser.d b/dyaml/parser.d index 44616b7..00bef57 100644 --- a/dyaml/parser.d +++ b/dyaml/parser.d @@ -351,7 +351,7 @@ final class Parser enforce(YAMLVersion_ is null, new Error("Duplicate YAML directive", token.startMark)); const minor = parts[1].split(".")[0]; - enforce(to!int(minor) == 1, + enforce(minor == "1", new Error("Incompatible document (version 1.x is required)", token.startMark)); YAMLVersion_ = parts[1];