summaryrefslogtreecommitdiff
path: root/parser.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-04-16 08:46:25 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-04-16 08:46:25 +0200
commite0a5db9c8b1df89db6ee0195cb9e304eee34b7ed (patch)
treeeb59e8cdd66a1ca8869f508f5ba9a0eda4e554dd /parser.py
parentf26a259a769edcf9a62233ea3c605c92dc3c8073 (diff)
downloadruamel.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.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.py b/parser.py
index a7d082c..0354b6d 100644
--- a/parser.py
+++ b/parser.py
@@ -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(