diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 17:35:24 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 17:35:24 +0200 |
commit | bf95947e11492f1060819036694daed38237d10e (patch) | |
tree | 10379f559c2192fb07809579799dc9225d2a8521 /parser.py | |
parent | 21ddf0cc5db2ef31a2852308f6c5926521b5b3a7 (diff) | |
download | ruamel.yaml-bf95947e11492f1060819036694daed38237d10e.tar.gz |
fix issue #163 comment disappearing in list before flow mapping
should be fixed in 0.15.54
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so usingthe WorkFlow pull-down (close to the top right of this page)*
Diffstat (limited to 'parser.py')
-rw-r--r-- | parser.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -434,9 +434,16 @@ class Parser(object): ) self.state = self.parse_flow_sequence_first_entry elif self.scanner.check_token(FlowMappingStartToken): + pt = self.scanner.peek_token() end_mark = self.scanner.peek_token().end_mark event = MappingStartEvent( - anchor, tag, implicit, start_mark, end_mark, flow_style=True + anchor, + tag, + implicit, + start_mark, + end_mark, + flow_style=True, + comment=pt.comment, ) self.state = self.parse_flow_mapping_first_key elif block and self.scanner.check_token(BlockSequenceStartToken): |