Fix a crashing yaml bug when parsing block scalars. R=rnystrom@google.com BUG= Review URL: https://codereview.chromium.org//801573003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/yaml@42309 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/yaml/CHANGELOG.md b/pkgs/yaml/CHANGELOG.md index 80548ed..b864250 100644 --- a/pkgs/yaml/CHANGELOG.md +++ b/pkgs/yaml/CHANGELOG.md
@@ -1,3 +1,7 @@ +## 2.1.2 + +* Fix a crashing bug when parsing block scalars. + ## 2.1.1 * Properly scope `SourceSpan`s for scalar values surrounded by whitespace.
diff --git a/pkgs/yaml/lib/src/scanner.dart b/pkgs/yaml/lib/src/scanner.dart index 6c702c8..e1b578e 100644 --- a/pkgs/yaml/lib/src/scanner.dart +++ b/pkgs/yaml/lib/src/scanner.dart
@@ -1156,7 +1156,7 @@ var leadingBreak = ''; var leadingBlank = false; var trailingBlank = false; - var end = _scanner.position; + var end = _scanner.state; while (_scanner.column == indent && !_scanner.isDone) { // Check for a document indicator. libyaml doesn't do this, but the spec // mandates it. See example 9.5: @@ -1189,7 +1189,7 @@ _scanner.readChar(); } buffer.write(_scanner.substring(startPosition)); - end = _scanner.position; + end = _scanner.state; // libyaml always reads a line here, but this breaks on block scalars at // the end of the document that end without newlines. See example 8.1:
diff --git a/pkgs/yaml/pubspec.yaml b/pkgs/yaml/pubspec.yaml index f149b1f..88650fc 100644 --- a/pkgs/yaml/pubspec.yaml +++ b/pkgs/yaml/pubspec.yaml
@@ -1,5 +1,5 @@ name: yaml -version: 2.1.1 +version: 2.1.2 author: "Dart Team <misc@dartlang.org>" homepage: http://www.dartlang.org description: A parser for YAML.