kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

anchors/aliases for map keys don't work #291

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The following YAML

first:
  &baz foo: bar
second:
  *baz: bar

should be equivalent to

first: 
  foo: bar
second: 
  foo: bar

However, the following code

#include <yaml-cpp/yaml.h>
#include <iostream>
int main() {
  YAML::Node doc = YAML::Load(
    "first:\n"
    "  &baz foo: bar\n"
    "second:\n"
    "  *baz: bar\n"
    );
  std::cout << doc["first"] << std::endl;
  return 0;
}

produces the error

terminate called after throwing an instance of 'YAML::ParserException'
  what():  yaml-cpp: error at line 4, column 3: the referenced anchor is not defined
Aborted (core dumped)

I am using yaml-cpp 0.5.1 on Ubuntu 14.04.

Original issue reported on code.google.com by mrshr...@gmail.com on 14 May 2015 at 4:36

GoogleCodeExporter commented 8 years ago
Thanks for the report. We've moved to GitHub now - can you file this issue 
there?

Original comment by jbe...@gmail.com on 14 May 2015 at 6:38

GoogleCodeExporter commented 8 years ago
Thanks for the heads up--issue has been filed on github.

Original comment by mrshr...@gmail.com on 14 May 2015 at 6:48