From 4e78012403a451090b72af539df0d976e8148ec4 Mon Sep 17 00:00:00 2001 From: xi Date: Mon, 17 Apr 2006 06:42:08 +0000 Subject: [PATCH] Fix #4 (Thanks to murphy(at)rubychan.de) git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@138 18f92427-320e-0410-9341-c67f048884a3 --- lib/yaml/scanner.py | 1 - tests/data/scan-document-end-bug.canonical | 3 +++ tests/data/scan-document-end-bug.data | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/data/scan-document-end-bug.canonical create mode 100644 tests/data/scan-document-end-bug.data diff --git a/lib/yaml/scanner.py b/lib/yaml/scanner.py index e9780c4..30add9e 100644 --- a/lib/yaml/scanner.py +++ b/lib/yaml/scanner.py @@ -701,7 +701,6 @@ class Scanner: # DOCUMENT-END: ^ '...' (' '|'\n') if self.column == 0: - prefix = self.peek(4) if self.prefix(3) == u'...' \ and self.peek(3) in u'\0 \t\r\n\x85\u2028\u2029': return True diff --git a/tests/data/scan-document-end-bug.canonical b/tests/data/scan-document-end-bug.canonical new file mode 100644 index 0000000..4a0e8a8 --- /dev/null +++ b/tests/data/scan-document-end-bug.canonical @@ -0,0 +1,3 @@ +%YAML 1.1 +--- +!!null "" diff --git a/tests/data/scan-document-end-bug.data b/tests/data/scan-document-end-bug.data new file mode 100644 index 0000000..3c70543 --- /dev/null +++ b/tests/data/scan-document-end-bug.data @@ -0,0 +1,3 @@ +# Ticket #4 +--- +... \ No newline at end of file -- 2.11.4.GIT