| Index: utils/pub/yaml/composer.dart
|
| diff --git a/utils/pub/yaml/composer.dart b/utils/pub/yaml/composer.dart
|
| index ada81267d8c453120cd7f45035b72085b8656d54..d915294660833f15014156d230bf35400aeda73b 100644
|
| --- a/utils/pub/yaml/composer.dart
|
| +++ b/utils/pub/yaml/composer.dart
|
| @@ -152,14 +152,18 @@ class _Composer extends _Visitor {
|
| "^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?\$").
|
| firstMatch(content);
|
| if (match != null) {
|
| + // YAML allows floats of the form "0.", but Dart does not. Fix up those
|
| + // floats by removing the trailing dot.
|
| + var matchStr = match.group(0).replaceAll(new RegExp(@"\.$"), "");
|
| return new _ScalarNode(_Tag.yaml("float"),
|
| - value: Math.parseDouble(match.group(0)));
|
| + value: Math.parseDouble(matchStr));
|
| }
|
|
|
| match = const RegExp("^([+-]?)\.(inf|Inf|INF)\$").firstMatch(content);
|
| if (match != null) {
|
| + var infinityStr = match.group(1) == "-" ? "-Infinity" : "Infinity";
|
| return new _ScalarNode(_Tag.yaml("float"),
|
| - value: Math.parseDouble("${match.group(1)}Infinity"));
|
| + value: Math.parseDouble(infinityStr));
|
| }
|
|
|
| match = const RegExp("^\.(nan|NaN|NAN)\$").firstMatch(content);
|
|
|