summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2009-08-29 22:12:45 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2009-08-29 22:12:45 +0000
commitc5d530ce0258e7bc8cda639a62eabb378b909b24 (patch)
treee6f2a8e49958e13470130e9525a57bb0f129be4e
parent84fc7e0993cd08082184abc8f553267b47c6a11e (diff)
downloadpyyaml-c5d530ce0258e7bc8cda639a62eabb378b909b24.tar.gz
Fixed a problem with a scanner error not detected when no line break at the end of the stream.
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@354 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r--lib/yaml/scanner.py3
-rw-r--r--lib3/yaml/scanner.py3
-rw-r--r--tests/data/invalid-item-without-trailing-break.loader-error2
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/yaml/scanner.py b/lib/yaml/scanner.py
index 8bccdc3..5228fad 100644
--- a/lib/yaml/scanner.py
+++ b/lib/yaml/scanner.py
@@ -374,7 +374,8 @@ class Scanner(object):
# Set the current intendation to -1.
self.unwind_indent(-1)
- # Reset everything (not really needed).
+ # Reset simple keys.
+ self.remove_possible_simple_key()
self.allow_simple_key = False
self.possible_simple_keys = {}
diff --git a/lib3/yaml/scanner.py b/lib3/yaml/scanner.py
index 5c2a30b..494d975 100644
--- a/lib3/yaml/scanner.py
+++ b/lib3/yaml/scanner.py
@@ -374,7 +374,8 @@ class Scanner:
# Set the current intendation to -1.
self.unwind_indent(-1)
- # Reset everything (not really needed).
+ # Reset simple keys.
+ self.remove_possible_simple_key()
self.allow_simple_key = False
self.possible_simple_keys = {}
diff --git a/tests/data/invalid-item-without-trailing-break.loader-error b/tests/data/invalid-item-without-trailing-break.loader-error
new file mode 100644
index 0000000..fdcf6c6
--- /dev/null
+++ b/tests/data/invalid-item-without-trailing-break.loader-error
@@ -0,0 +1,2 @@
+-
+-0 \ No newline at end of file