public void DocumentStart() { var doc = new YDocument(); Documents.Add(doc); nodeStack.Push(doc); anchors = new Dictionary<string, YNode>(); }
public void DocumentStart() { var doc = new YDocument(); Documents.Add(doc); nodeStack.Push(doc); anchors = new Dictionary <string, YNode>(); }
static void EmitTest(YDocument doc) { doc = doc ?? new YDocument( new YMapping(new Dictionary <YScalar, YNode> { { "x", new YSequence(new YScalar("a"), new YScalar("b")) }, { "y", new YMapping(new Dictionary <YScalar, YNode> { { "f", new YSequence(new YScalar("g"), new YScalar("h")) }, { "i", new YScalar("jk") } }) }, }) ); string yaml = Yaml.Dump(doc); Console.WriteLine(yaml); }
private static void AliasTest() { var repeatNode = new YMapping(new Dictionary <YScalar, YNode> { { "f", new YSequence(new YScalar("g"), new YScalar("h")) }, { "i", new YScalar("jk") } }); var doc = new YDocument( new YMapping(new Dictionary <YScalar, YNode> { { "x", new YSequence(new YScalar("a"), new YScalar("b"), repeatNode) }, { "y", repeatNode }, { "z", repeatNode } }) ); string yaml = Yaml.Dump(doc); Console.WriteLine(yaml); }