def construct_yaml_map(self, node): """ Return a node class representing a line-marked dictionary. """ obj, = SafeConstructor.construct_yaml_map(self, node) return DictNode(obj, node.start_mark, node.end_mark)
def construct_yaml_map(self, node): # Check for duplicate keys on the current level, this is not desirable # because a dict does not support this. It overwrites it with the last # occurance, which can give unexpected results mapping = {} self.flatten_mapping(node) for key_node, value_node in node.value: key = self.construct_object(key_node, False) value = self.construct_object(value_node, False) if key in mapping: raise CfnParseError(self.filename, [ build_match( filename=self.filename, message='Duplicate resource found "{}" (line {})'. format(key, key_node.start_mark.line + 1), line_number=key_node.start_mark.line, column_number=key_node.start_mark.column, key=key), build_match( filename=self.filename, message='Duplicate resource found "{}" (line {})'. format(key, mapping[key].start_mark.line + 1), line_number=mapping[key].start_mark.line, column_number=mapping[key].start_mark.column, key=key) ]) mapping[key] = value obj, = SafeConstructor.construct_yaml_map(self, node) return dict_node(obj, node.start_mark, node.end_mark)
def construct_yaml_map(self, node): # Check for duplicate keys on the current level, this is not desirable # because a dict does not support this. It overwrites it with the last # occurance, which can give unexpected results mapping = {} for key_node, value_node in node.value: key = self.construct_object(key_node, False) value = self.construct_object(value_node, False) if key in mapping: raise DuplicateError('"{}" (line {})'.format( key, key_node.start_mark.line + 1)) mapping[key] = value obj, = SafeConstructor.construct_yaml_map(self, node) return dict_node(obj, node.start_mark, node.end_mark)
def construct_yaml_map(self, node): obj, = SafeConstructor.construct_yaml_map(self, node) return dict_node(obj, node.start_mark, node.end_mark)
def construct_yaml_map(self, node): (obj, ) = SafeConstructor.construct_yaml_map(self, node) return dict_node(obj, node.start_mark, node.end_mark)
def construct_yaml_map(self, node): obj, = SafeConstructor.construct_yaml_map(self, node) return self._holder(obj, node)
def construct_yaml_map(self, node): obj, = SafeConstructor.construct_yaml_map(self, node) return dict_node(obj, node_info=node)