public AddNodeWithUnresolvedAliases ( |
||
node |
/// The |
|
Результат | void |
internal YamlMappingNode(EventReader events, DocumentLoadingState state) { this.children = new Dictionary <YamlNode, YamlNode>(); MappingStart yamlEvent = events.Expect <MappingStart>(); base.Load(yamlEvent, state); bool flag = false; while (!events.Accept <MappingEnd>()) { YamlNode key = ParseNode(events, state); YamlNode node2 = ParseNode(events, state); try { this.children.Add(key, node2); } catch (ArgumentException exception) { throw new YamlException(key.Start, key.End, "Duplicate key", exception); } flag |= (key is YamlAliasNode) || (node2 is YamlAliasNode); } if (flag) { state.AddNodeWithUnresolvedAliases(this); } events.Expect <MappingEnd>(); }
/// <summary> /// Initializes a new instance of the <see cref="YamlSequenceNode"/> class. /// </summary> /// <param name="events">The events.</param> /// <param name="state">The state.</param> internal YamlSequenceNode(EventReader events, DocumentLoadingState state) { SequenceStart sequence = events.Expect <SequenceStart>(); Load(sequence, state); bool hasUnresolvedAliases = false; while (!events.Accept <SequenceEnd>()) { YamlNode child = ParseNode(events, state); children.Add(child); hasUnresolvedAliases |= child is YamlAliasNode; } if (hasUnresolvedAliases) { state.AddNodeWithUnresolvedAliases(this); } #if DEBUG else { foreach (var child in children) { if (child is YamlAliasNode) { throw new InvalidOperationException("Error in alias resolution."); } } } #endif events.Expect <SequenceEnd>(); }
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) { 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 sequence = parser.Expect <SequenceStart>(); Load(sequence, state); Style = sequence.Style; bool hasUnresolvedAliases = false; while (!parser.Accept <SequenceEnd>()) { var child = ParseNode(parser, state); children.Add(child); hasUnresolvedAliases |= child is YamlAliasNode; } if (hasUnresolvedAliases) { state.AddNodeWithUnresolvedAliases(this); } #if DEBUG else { foreach (var child in children) { if (child is YamlAliasNode) { throw new InvalidOperationException("Error in alias resolution."); } } } #endif parser.Expect <SequenceEnd>(); }
/// <summary> /// Initializes a new instance of the <see cref="YamlMappingNode"/> class. /// </summary> /// <param name="events">The events.</param> /// <param name="state">The state.</param> internal YamlMappingNode(EventReader events, DocumentLoadingState state, bool overrideKeys) { MappingStart mapping = events.Expect <MappingStart>(); Load(mapping, state); bool hasUnresolvedAliases = false; while (!events.Accept <MappingEnd>()) { YamlNode key = ParseNode(events, state, overrideKeys); YamlNode value = ParseNode(events, state, overrideKeys); try { if (children.ContainsKey(key) && overrideKeys) { children[key] = value; } else { 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 events.Expect <MappingEnd>(); }
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>(); }
internal YamlSequenceNode(EventReader events, DocumentLoadingState state) { this.children = new List <YamlNode>(); SequenceStart yamlEvent = events.Expect <SequenceStart>(); base.Load(yamlEvent, state); bool flag = false; while (!events.Accept <SequenceEnd>()) { YamlNode item = ParseNode(events, state); this.children.Add(item); flag |= item is YamlAliasNode; } if (flag) { state.AddNodeWithUnresolvedAliases(this); } events.Expect <SequenceEnd>(); }
private void Load(IParser parser, DocumentLoadingState state) { SequenceStart sequenceStart = parser.Expect <SequenceStart>(); Load(sequenceStart, state); Style = sequenceStart.Style; bool flag = false; while (!parser.Accept <SequenceEnd>()) { YamlNode yamlNode = YamlNode.ParseNode(parser, state); children.Add(yamlNode); flag |= (yamlNode is YamlAliasNode); } if (flag) { state.AddNodeWithUnresolvedAliases(this); } parser.Expect <SequenceEnd>(); }
private void Load(IParser parser, DocumentLoadingState state) { var sequence = parser.Consume <SequenceStart>(); Load(sequence, state); Style = sequence.Style; var hasUnresolvedAliases = false; while (!parser.TryConsume <SequenceEnd>(out var _)) { var child = ParseNode(parser, state); children.Add(child); hasUnresolvedAliases |= child is YamlAliasNode; } if (hasUnresolvedAliases) { state.AddNodeWithUnresolvedAliases(this); } }