Make null handling YAML 1.2 compliant.

This commit is contained in:
TripleWhy
2016-04-02 00:14:59 +02:00
committed by Jesse Beder
parent 34bd1a7083
commit 52bcefa1f1
4 changed files with 10 additions and 6 deletions

View File

@@ -9,6 +9,7 @@
#include "stringsource.h"
#include "yaml-cpp/binary.h" // IWYU pragma: keep
#include "yaml-cpp/ostream_wrapper.h"
#include "yaml-cpp/null.h"
namespace YAML {
namespace Utils {
@@ -152,12 +153,8 @@ void WriteCodePoint(ostream_wrapper& out, int codePoint) {
bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
bool allowOnlyAscii) {
if (str.empty()) {
return false;
}
// check against null
if (str == "null") {
if (IsNullString(str)) {
return false;
}