Index: /pyyaml/trunk/tests/data/fetch-complex-value-bug.loader-error
===================================================================
--- /pyyaml/trunk/tests/data/fetch-complex-value-bug.loader-error	(revision 188)
+++ /pyyaml/trunk/tests/data/fetch-complex-value-bug.loader-error	(revision 188)
@@ -0,0 +1,2 @@
+? "foo"
+ : "bar"
Index: /pyyaml/trunk/tests/data/remove-possible-simple-key-bug.loader-error
===================================================================
--- /pyyaml/trunk/tests/data/remove-possible-simple-key-bug.loader-error	(revision 188)
+++ /pyyaml/trunk/tests/data/remove-possible-simple-key-bug.loader-error	(revision 188)
@@ -0,0 +1,3 @@
+foo: &A bar
+*A ]    # The ']' indicator triggers remove_possible_simple_key,
+        # which should raise an error.
Index: /pyyaml/trunk/lib/yaml/scanner.py
===================================================================
--- /pyyaml/trunk/lib/yaml/scanner.py	(revision 149)
+++ /pyyaml/trunk/lib/yaml/scanner.py	(revision 188)
@@ -215,9 +215,9 @@
 
         # Is it the flow entry indicator?
-        if ch in u',':
+        if ch == u',':
             return self.fetch_flow_entry()
 
         # Is it the block entry indicator?
-        if ch in u'-' and self.check_block_entry():
+        if ch == u'-' and self.check_block_entry():
             return self.fetch_block_entry()
 
@@ -326,9 +326,9 @@
             key = self.possible_simple_keys[self.flow_level]
             
-            # I don't think it's possible, but I could be wrong.
-            assert not key.required
-            #if key.required:
-            #    raise ScannerError("while scanning a simple key", key.mark,
-            #            "could not found expected ':'", self.get_mark())
+            if key.required:
+                raise ScannerError("while scanning a simple key", key.mark,
+                        "could not found expected ':'", self.get_mark())
+
+            del self.possible_simple_keys[self.flow_level]
 
     # Indentation functions.
@@ -588,4 +588,12 @@
                             "mapping values are not allowed here",
                             self.get_mark())
+
+            # If this value starts a new block mapping, we need to add
+            # BLOCK-MAPPING-START.  It will be detected as an error later by
+            # the parser.
+            if not self.flow_level:
+                if self.add_indent(self.column):
+                    mark = self.get_mark()
+                    self.tokens.append(BlockMappingStartToken(mark, mark))
 
             # Simple keys are allowed after ':' in the block context.
Index: /pyyaml/trunk/lib/yaml/reader.py
===================================================================
--- /pyyaml/trunk/lib/yaml/reader.py	(revision 173)
+++ /pyyaml/trunk/lib/yaml/reader.py	(revision 188)
@@ -140,5 +140,5 @@
             self.index += 1
             if ch in u'\n\x85\u2028\u2029'  \
-                    or (ch == u'\r' and self.buffer[self.pointer+1] != u'\n'):
+                    or (ch == u'\r' and self.buffer[self.pointer] != u'\n'):
                 self.line += 1
                 self.column = 0
