summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-01-23 12:23:47 +0100
committerAnthon van der Neut <anthon@mnt.org>2017-01-23 12:23:47 +0100
commit610bebfbbc8887195f1ad9f52adbed7ffcf70876 (patch)
tree20567b150c64f93b051645be03312c0676de3e15 /scanner.py
parent5f73166ac799522dea0377044b4f1df12c27c331 (diff)
downloadruamel.yaml-610bebfbbc8887195f1ad9f52adbed7ffcf70876.tar.gz
allow ':' in flow-style scalar when not followed by space0.13.11
Diffstat (limited to 'scanner.py')
-rw-r--r--scanner.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scanner.py b/scanner.py
index 2a57c5d..ce12500 100644
--- a/scanner.py
+++ b/scanner.py
@@ -1344,10 +1344,13 @@ class Scanner(object):
break
while True:
ch = self.peek(length)
- if ch in u'\0 \t\r\n\x85\u2028\u2029' \
- or (not self.flow_level and ch == u':' and
- self.peek(length+1) in u'\0 \t\r\n\x85\u2028\u2029') \
- or (self.flow_level and ch in u',:?[]{}'):
+ if (ch == u':' and
+ self.peek(length+1) not in u'\0 \t\r\n\x85\u2028\u2029'):
+ pass
+ elif (ch in u'\0 \t\r\n\x85\u2028\u2029' or
+ (not self.flow_level and ch == u':' and
+ self.peek(length+1) in u'\0 \t\r\n\x85\u2028\u2029') or
+ (self.flow_level and ch in u',:?[]{}')):
break
length += 1
# It's not clear what we should do with ':' in the flow context.