Commit 49265fa1 authored by jbeder's avatar jbeder
Browse files

Fixed empty scalar in sequence bug

parent c043b9c6
......@@ -264,7 +264,7 @@ namespace YAML
if(node.m_pContent)
node.m_pContent->Write(out);
else
out << "";
out << Null;
return out;
}
......
......@@ -4,6 +4,7 @@
#include "scanner.h"
#include "token.h"
#include "emitter.h"
#include <stdexcept>
namespace YAML
{
......@@ -80,6 +81,14 @@ namespace YAML
Node *pNode = new Node;
m_data.push_back(pNode);
// check for null
if(!pScanner->empty()) {
const Token& token = pScanner->peek();
if(token.type == TT_BLOCK_ENTRY || token.type == TT_BLOCK_END)
continue;
}
pNode->Parse(pScanner, state);
}
}
......
......@@ -30,7 +30,8 @@ namespace YAML
TT_ANCHOR,
TT_ALIAS,
TT_TAG,
TT_SCALAR
TT_SCALAR,
TT_NULL
};
const std::string TokenNames[] = {
......@@ -51,7 +52,8 @@ namespace YAML
"ANCHOR",
"ALIAS",
"TAG",
"SCALAR"
"SCALAR",
"NULL"
};
struct Token {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment