private void Load(IParser parser, DocumentLoadingState state) { MappingStart mappingStart = parser.Expect <MappingStart>(); Load(mappingStart, state); Style = mappingStart.Style; bool flag = false; while (!parser.Accept <MappingEnd>()) { YamlNode yamlNode = YamlNode.ParseNode(parser, state); YamlNode yamlNode2 = YamlNode.ParseNode(parser, state); try { children.Add(yamlNode, yamlNode2); } catch (ArgumentException innerException) { throw new YamlException(yamlNode.Start, yamlNode.End, "Duplicate key", innerException); } flag |= (yamlNode is YamlAliasNode || yamlNode2 is YamlAliasNode); } if (flag) { state.AddNodeWithUnresolvedAliases(this); } parser.Expect <MappingEnd>(); }
private void Load(IParser parser, DocumentLoadingState state) { var mapping = parser.Consume <MappingStart>(); Load(mapping, state); Style = mapping.Style; bool hasUnresolvedAliases = false; while (!parser.TryConsume <MappingEnd>(out var _)) { var key = ParseNode(parser, state); var value = ParseNode(parser, state); try { children.Add(key, value); } catch (ArgumentException err) { throw new YamlException(key.Start, key.End, "Duplicate key", err); } hasUnresolvedAliases |= key is YamlAliasNode || value is YamlAliasNode; } if (hasUnresolvedAliases) { state.AddNodeWithUnresolvedAliases(this); } }
private void Load(IParser parser, DocumentLoadingState state) { var mapping = parser.Expect <MappingStart>(); Load(mapping, state); Style = mapping.Style; bool hasUnresolvedAliases = false; while (!parser.Accept <MappingEnd>()) { var key = ParseNode(parser, state); var value = ParseNode(parser, state); try { children.Add(key, value); } catch (ArgumentException err) { throw new YamlException(key.Start, key.End, "Duplicate key", err); } hasUnresolvedAliases |= key is YamlAliasNode || value is YamlAliasNode; } if (hasUnresolvedAliases) { state.AddNodeWithUnresolvedAliases(this); } #if DEBUG else { foreach (var child in children) { if (child.Key is YamlAliasNode) { throw new InvalidOperationException("Error in alias resolution."); } if (child.Value is YamlAliasNode) { throw new InvalidOperationException("Error in alias resolution."); } } } #endif parser.Expect <MappingEnd>(); }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> /// <param name="start">The start position of the event.</param> /// <param name="end">The end position of the event.</param> public MappingStart(string anchor, string tag, bool isImplicit, MappingStyle style, Mark start, Mark end) : base(anchor, tag, start, end) { this.isImplicit = isImplicit; this.style = style; }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> public MappingStart(string anchor, string tag, bool isImplicit, MappingStyle style) : this(anchor, tag, isImplicit, style, Mark.Empty, Mark.Empty) { }
public MappingStartBuilder(MappingStyle style) { this.style = style; @implicit = DefaultImplicit; }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> /// <param name="start">The start position of the event.</param> /// <param name="end">The end position of the event.</param> public MappingStart(string anchor, string tag, bool isImplicit, MappingStyle style, Mark start, Mark end) : base(anchor, tag, start, end) { this.isImplicit = isImplicit; this.style = style; }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> public MappingStart(string anchor, string tag, bool isImplicit, MappingStyle style) : this(anchor, tag, isImplicit, style, Mark.Empty, Mark.Empty) { }
public YAMLMappingNode(MappingStyle style) { Style = style; }
public MappingStartBuilder(MappingStyle style) { this.style = style; @implicit = DefaultImplicit; }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> public MappingStart(AnchorName anchor, TagName tag, bool isImplicit, MappingStyle style) : this(anchor, tag, isImplicit, style, Mark.Empty, Mark.Empty) { }
/// <summary> /// Initializes a new instance of the <see cref="MappingStart"/> class. /// </summary> /// <param name="anchor">The anchor.</param> /// <param name="tag">The tag.</param> /// <param name="isImplicit">Indicates whether the event is implicit.</param> /// <param name="style">The style of the mapping.</param> /// <param name="start">The start position of the event.</param> /// <param name="end">The end position of the event.</param> public MappingStart(AnchorName anchor, TagName tag, bool isImplicit, MappingStyle style, Mark start, Mark end) : base(anchor, tag, start, end) { this.IsImplicit = isImplicit; this.Style = style; }