diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-08-30 06:47:53 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-08-30 06:47:53 +0200 |
commit | 34d02af74473c82e25c9e152a24ffeea862454f0 (patch) | |
tree | b27b185d183890b5ad278ee0ebdc3f6a162d7a3d /constructor.py | |
parent | 22ebda34b13607bd4516c36820552d5daa43df70 (diff) | |
download | ruamel.yaml-34d02af74473c82e25c9e152a24ffeea862454f0.tar.gz |
allow round trip of tagged sequences
Diffstat (limited to 'constructor.py')
-rw-r--r-- | constructor.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/constructor.py b/constructor.py index 008018a..26a4dd1 100644 --- a/constructor.py +++ b/constructor.py @@ -1561,6 +1561,17 @@ class RoundTripConstructor(SafeConstructor): data2.yaml_set_tag(node.tag) yield data2 return + elif isinstance(node, SequenceNode): + data = CommentedSeq() + data._yaml_set_line_col(node.start_mark.line, node.start_mark.column) + if node.flow_style is True: + data.fa.set_flow_style() + elif node.flow_style is False: + data.fa.set_block_style() + data.yaml_set_tag(node.tag) + yield data + data.extend(self.construct_sequence(node)) + return except: # NOQA pass raise ConstructorError( |