diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 15:58:03 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-08-12 15:58:03 +0200 |
commit | 21ddf0cc5db2ef31a2852308f6c5926521b5b3a7 (patch) | |
tree | 9cde92371e23e7752f5f787f6b7372f23bafd2c9 /parser.py | |
parent | bf94f1d0fe36687a09beb7a4d48564127b9d157e (diff) | |
download | ruamel.yaml-21ddf0cc5db2ef31a2852308f6c5926521b5b3a7.tar.gz |
fix issue #161 doubling comment on empty value
Diffstat (limited to 'parser.py')
-rw-r--r-- | parser.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -598,7 +598,11 @@ class Parser(object): self.state = self.parse_block_mapping_key comment = token.comment if comment is None: - comment = self.scanner.peek_token().comment + token = self.scanner.peek_token() + comment = token.comment + if comment: + token._comment = [None, comment[1]] + comment = [comment[0], None] return self.process_empty_scalar(token.end_mark, comment=comment) else: self.state = self.parse_block_mapping_key |