diff options
author | Anthon van der Neut <anthon@mnt.org> | 2019-04-16 08:46:25 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2019-04-16 08:46:25 +0200 |
commit | e0a5db9c8b1df89db6ee0195cb9e304eee34b7ed (patch) | |
tree | eb59e8cdd66a1ca8869f508f5ba9a0eda4e554dd /parser.py | |
parent | f26a259a769edcf9a62233ea3c605c92dc3c8073 (diff) | |
download | ruamel.yaml-e0a5db9c8b1df89db6ee0195cb9e304eee34b7ed.tar.gz |
YAML 1.2 allows empty implicit keys in block style mappings0.15.92
fixes issue #284
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'parser.py')
-rw-r--r-- | parser.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -71,7 +71,7 @@ from __future__ import absolute_import # flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START # FLOW-MAPPING-START KEY } -# need to have full path, as pkg_resources tries to load parser.py in __init__.py +# need to have full path with import, as pkg_resources tries to load parser.py in __init__.py # only to not do anything with the package afterwards # and for Jython too @@ -569,6 +569,9 @@ class Parser(object): else: self.state = self.parse_block_mapping_value return self.process_empty_scalar(token.end_mark) + if self.resolver.processing_version > (1, 1) and self.scanner.check_token(ValueToken): + self.state = self.parse_block_mapping_value + return self.process_empty_scalar(self.scanner.peek_token().start_mark) if not self.scanner.check_token(BlockEndToken): token = self.scanner.peek_token() raise ParserError( |