Fix float resolver for '.' and '._'
A single dot matches the official YAML 1.1 int regex.
This was probably unintended. The regex now requires at least
a digit before or after the dot.
diff --git a/lib/yaml/resolver.py b/lib/yaml/resolver.py
index 013896d..3522bda 100644
--- a/lib/yaml/resolver.py
+++ b/lib/yaml/resolver.py
@@ -177,7 +177,7 @@
Resolver.add_implicit_resolver(
'tag:yaml.org,2002:float',
re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?
- |\.[0-9_]+(?:[eE][-+][0-9]+)?
+ |\.[0-9][0-9_]*(?:[eE][-+][0-9]+)?
|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*
|[-+]?\.(?:inf|Inf|INF)
|\.(?:nan|NaN|NAN))$''', re.X),
diff --git a/tests/data/yaml11.schema-skip b/tests/data/yaml11.schema-skip
index 4fe0f0b..2d78a61 100644
--- a/tests/data/yaml11.schema-skip
+++ b/tests/data/yaml11.schema-skip
@@ -1,8 +1,6 @@
load: {
'Y': 1, 'y': 1, 'N': 1, 'n': 1,
'!!bool Y': 1, '!!bool N': 1, '!!bool n': 1, '!!bool y': 1,
- '._', '!!str ._',
- '._14', '!!str ._14'
}
dump: {
'!!str N': 1, '!!str Y': 1, '!!str n': 1, '!!str y': 1,