Tags, anchors, and aliases are all parsed now.

This commit is contained in:
Jesse Beder 2008-07-01 06:28:10 +00:00
parent 8180a85a3b
commit 4c5a488f68
19 changed files with 303 additions and 93 deletions

25
parserstate.cpp Normal file
View file

@ -0,0 +1,25 @@
#include "parserstate.h"
namespace YAML
{
void ParserState::Reset()
{
// version
version.major = 1;
version.minor = 1;
// and tags
tags.clear();
tags["!"] = "!";
tags["!!"] = "tag:yaml.org,2002:";
}
std::string ParserState::TranslateTag(const std::string& handle) const
{
std::map <std::string, std::string>::const_iterator it = tags.find(handle);
if(it == tags.end())
return handle;
return it->second;
}
}