diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-01-23 12:23:47 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-01-23 12:23:47 +0100 |
commit | 610bebfbbc8887195f1ad9f52adbed7ffcf70876 (patch) | |
tree | 20567b150c64f93b051645be03312c0676de3e15 /scanner.py | |
parent | 5f73166ac799522dea0377044b4f1df12c27c331 (diff) | |
download | ruamel.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.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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. |