Commit 07e88a78 authored by Jesse Beder's avatar Jesse Beder
Browse files

Added alias

parent c5e4bdee
......@@ -512,7 +512,19 @@ namespace YAML
{
if(!good())
return *this;
if(m_pState->HasAnchor() || m_pState->HasTag()) {
m_pState->SetError(ErrorMsg::INVALID_ALIAS);
return *this;
}
PrepareNode(EmitterNodeType::Scalar);
if(!Utils::WriteAlias(m_stream, alias.content)) {
m_pState->SetError(ErrorMsg::INVALID_ALIAS);
return *this;
}
m_pState->BeginScalar();
return *this;
......
......@@ -9,13 +9,13 @@ int main()
out << "foo";
out << YAML::LocalTag("hi") << "bar";
out << YAML::Anchor("asdf") << YAML::BeginMap;
out << "a" << "b" << "c" << YAML::Newline;
out << "a" << "b" << "c";
out << YAML::Anchor("a") << YAML::BeginMap;
out << "a" << "b";
out << YAML::Anchor("d") << "a" << "b";
out << YAML::EndMap;
out << YAML::EndMap;
out << YAML::LocalTag("hi") << YAML::BeginSeq;
out << "a" << "b";
out << "a" << "b" << YAML::Alias("monkey");
out << YAML::EndSeq;
out << YAML::EndSeq;
......
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