Merged the other-tags branch into the trunk (this wasn't an rX:Y merge, since the branch wasn't branched directly from the head of the trunk)

This commit is contained in:
Jesse Beder
2010-10-19 06:46:55 +00:00
parent 18a805e46c
commit 51c84f1c02
8 changed files with 64 additions and 21 deletions

View File

@@ -8,6 +8,7 @@
#include "token.h"
#include <sstream>
#include <cstdio>
#include <algorithm>
namespace YAML
{
@@ -73,10 +74,17 @@ namespace YAML
anchor_t anchor;
ParseProperties(tag, anchor);
const Token& token = m_scanner.peek();
// add non-specific tags
if(tag.empty())
tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
// now split based on what kind of node we should be
switch(m_scanner.peek().type) {
case Token::SCALAR:
eventHandler.OnScalar(mark, tag, anchor, m_scanner.peek().value);
switch(token.type) {
case Token::PLAIN_SCALAR:
case Token::NON_PLAIN_SCALAR:
eventHandler.OnScalar(mark, tag, anchor, token.value);
m_scanner.pop();
return;
case Token::FLOW_SEQ_START: