summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-01-08 18:15:29 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-01-08 18:15:29 +0100
commit4c9add02bb1126436897f61417c1e3a45311f4ac (patch)
treeb5ae450a10942d2e6026500c108dfadc341417d9 /scanner.py
parentc3245ebc020a76e5e31c9f0d756adde83dc3dec7 (diff)
downloadruamel.yaml-4c9add02bb1126436897f61417c1e3a45311f4ac.tar.gz
fix issue #275 not parsing valid flow style mapping with value starting with value indicator
This is only fixed in the pure python version! *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 'scanner.py')
-rw-r--r--scanner.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scanner.py b/scanner.py
index 38d6ff6..1296160 100644
--- a/scanner.py
+++ b/scanner.py
@@ -797,7 +797,10 @@ class Scanner(object):
if self.flow_context[-1] == '[':
if self.reader.peek(1) not in _THE_END_SPACE_TAB:
return False
- # if self.reader.peek(1) in '\'"{[]}':
+ elif self.tokens and isinstance(self.tokens[-1], ValueToken):
+ # mapping flow context scanning a value token
+ if self.reader.peek(1) not in _THE_END_SPACE_TAB:
+ return False
return True
# VALUE(block context): ':' (' '|'\n')
return self.reader.peek(1) in _THE_END_SPACE_TAB