Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: packages/yaml/lib/src/scanner.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/yaml/lib/src/parser.dart ('k') | packages/yaml/lib/src/style.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/yaml/lib/src/scanner.dart
diff --git a/packages/yaml/lib/src/scanner.dart b/packages/yaml/lib/src/scanner.dart
index 0ac86dce85e8b03747c273fa0993d310585785ee..9bf81143e3a3b1f7ebb3b195471417df26036680 100644
--- a/packages/yaml/lib/src/scanner.dart
+++ b/packages/yaml/lib/src/scanner.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library yaml.scanner;
-
import 'package:collection/collection.dart';
import 'package:string_scanner/string_scanner.dart';
import 'package:source_span/source_span.dart';
@@ -326,6 +324,9 @@ class Scanner {
if (_tokens.isNotEmpty) {
_staleSimpleKeys();
+ // If there are no more tokens to fetch, break.
+ if (_tokens.last.type == TokenType.STREAM_END) break;
+
// If the current token could be a simple key, we need to scan more
// tokens until we determine whether it is or not. Otherwise we might
// not emit the `KEY` token before we emit the value of the key.
@@ -462,8 +463,6 @@ class Scanner {
_fetchPlainScalar();
return;
}
-
- throw 'Inaccessible';
}
/// Throws an error about a disallowed character.
« no previous file with comments | « packages/yaml/lib/src/parser.dart ('k') | packages/yaml/lib/src/style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698