summaryrefslogtreecommitdiff
path: root/parser.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-12 17:35:24 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-12 17:35:24 +0200
commitbf95947e11492f1060819036694daed38237d10e (patch)
tree10379f559c2192fb07809579799dc9225d2a8521 /parser.py
parent21ddf0cc5db2ef31a2852308f6c5926521b5b3a7 (diff)
downloadruamel.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.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/parser.py b/parser.py
index 0707761..61ff673 100644
--- a/parser.py
+++ b/parser.py
@@ -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):