mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user