summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2006-03-01 09:28:46 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2006-03-01 09:28:46 +0000
commit9263f217ab8b5968c7802ec6267edd8b2ceefb20 (patch)
treeeba0f134e7123e469c5fbd1d08eb2150e28738c9
parentdc1a5ec85bef86add8a49cddab27d70b8deb552f (diff)
downloadpyyaml-master@60.tar.gz
Fixed a silly bug in ''scan_line_break''.master@60
Thanks Gustavo Rahal for reporting it. git-svn-id: http://svn.pyyaml.org/branches/pyyaml3000@60 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r--lib/yaml/scanner.py4
-rw-r--r--tests/data/scan-line-break-bug.canonical3
-rw-r--r--tests/data/scan-line-break-bug.data3
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/yaml/scanner.py b/lib/yaml/scanner.py
index 09e3bd6..80d69b6 100644
--- a/lib/yaml/scanner.py
+++ b/lib/yaml/scanner.py
@@ -95,7 +95,7 @@ class Scanner:
# (in block context),
# - after '{', '[', ',' (in the flow context),
# - after '?', ':', '-' (in the block context).
- # In the block context, this flag also signify if a block collection
+ # In the block context, this flag also signifies if a block collection
# may start at the current position.
self.allow_simple_key = True
@@ -1398,7 +1398,7 @@ class Scanner:
ch = self.reader.peek()
if ch in u'\r\n\x85':
if self.reader.prefix(2) == u'\r\n':
- self.forward(2)
+ self.reader.forward(2)
else:
self.reader.forward()
return u'\n'
diff --git a/tests/data/scan-line-break-bug.canonical b/tests/data/scan-line-break-bug.canonical
new file mode 100644
index 0000000..79f08b7
--- /dev/null
+++ b/tests/data/scan-line-break-bug.canonical
@@ -0,0 +1,3 @@
+%YAML 1.1
+---
+!!map { ? !!str "foo" : !!str "bar baz" }
diff --git a/tests/data/scan-line-break-bug.data b/tests/data/scan-line-break-bug.data
new file mode 100644
index 0000000..c974fab
--- /dev/null
+++ b/tests/data/scan-line-break-bug.data
@@ -0,0 +1,3 @@
+foo:
+ bar
+ baz