Kirill Simonov committed 8f9ca0e

Raise an error for colons in the flow context.

Comments (0)

Files changed (3)

-PyYAML3000 - The next generation YAML parser for Python.
+PyYAML 3000 - The next generation YAML parser and emitter for Python.
 To install, type 'python install'.
-For more information, check ''.
+For more information, check the PyYAML homepage:
 Post your questions and opinions to the YAML-Core mailing list:
-PyYAML3000 is written by Kirill Simonov <>. It is released
+Submit bug reports and feature requests to the PyYAML bug tracker:
+PyYAML 3000 is written by Kirill Simonov <>. It is released
 under the MIT license. See the file LICENSE for more details.


                         or (self.flow_level and ch in u',:?[]{}'):
                 length += 1
+            # It's not clear what we should do with ':' in the flow context.
+            if (self.flow_level and ch == u':'
+                    and self.peek(length+1) not in u'\0 \t\r\n\x28\u2028\u2029,[]{}'):
+                self.forward(length)
+                raise ScannerError("while scanning a plain scalar", start_mark,
+                    "found unexpected ':'", self.get_mark(),
+                    "Please check for details.")
             if length == 0:
             self.allow_simple_key = False


+{ foo:bar }