diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2006-08-16 21:07:47 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2006-08-16 21:07:47 +0000 |
commit | c49031eab3b25f8b494948d7590b09f1b3cb7485 (patch) | |
tree | 0c9aaa1b1f89a9993fd4f420fa1425d25b686bd8 | |
parent | 3193c0fd9dd09c961e7f4a528ba01e0d732a36ab (diff) | |
download | pyyaml-c49031eab3b25f8b494948d7590b09f1b3cb7485.tar.gz |
The 'N' plain scalar was still recognized as ``!!bool``. Fix it (close #26).
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@226 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r-- | lib/yaml/resolver.py | 2 | ||||
-rw-r--r-- | tests/data/construct-bool.code | 1 | ||||
-rw-r--r-- | tests/data/construct-bool.data | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/yaml/resolver.py b/lib/yaml/resolver.py index f49eda6..6062406 100644 --- a/lib/yaml/resolver.py +++ b/lib/yaml/resolver.py @@ -153,7 +153,7 @@ class Resolver(BaseResolver): Resolver.add_implicit_resolver( u'tag:yaml.org,2002:bool', - re.compile(ur'''^(?:yes|Yes|YES|n|N|no|No|NO + re.compile(ur'''^(?:yes|Yes|YES|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF)$''', re.X), list(u'yYnNtTfFoO')) diff --git a/tests/data/construct-bool.code b/tests/data/construct-bool.code index 389d2c0..3d02580 100644 --- a/tests/data/construct-bool.code +++ b/tests/data/construct-bool.code @@ -3,4 +3,5 @@ "answer": False, "logical": True, "option": True, + "but": { "y": "is a string", "n": "is a string" }, } diff --git a/tests/data/construct-bool.data b/tests/data/construct-bool.data index e751222..36d6519 100644 --- a/tests/data/construct-bool.data +++ b/tests/data/construct-bool.data @@ -2,3 +2,8 @@ canonical: yes answer: NO logical: True option: on + + +but: + y: is a string + n: is a string |