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

Side by Side Diff: packages/yaml/lib/src/scanner.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library yaml.scanner; 5 library yaml.scanner;
6 6
7 import 'package:collection/collection.dart'; 7 import 'package:collection/collection.dart';
8 import 'package:string_scanner/string_scanner.dart'; 8 import 'package:string_scanner/string_scanner.dart';
9 import 'package:source_span/source_span.dart'; 9 import 'package:source_span/source_span.dart';
10 10
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 return; 437 return;
438 case COLON: 438 case COLON:
439 if (!_inBlockContext && _tokens.isNotEmpty) { 439 if (!_inBlockContext && _tokens.isNotEmpty) {
440 // If a colon follows a "JSON-like" value (an explicit map or list, or 440 // If a colon follows a "JSON-like" value (an explicit map or list, or
441 // a quoted string) it isn't required to have whitespace after it 441 // a quoted string) it isn't required to have whitespace after it
442 // since it unambiguously describes a map. 442 // since it unambiguously describes a map.
443 var token = _tokens.last; 443 var token = _tokens.last;
444 if (token.type == TokenType.FLOW_SEQUENCE_END || 444 if (token.type == TokenType.FLOW_SEQUENCE_END ||
445 token.type == TokenType.FLOW_MAPPING_END || 445 token.type == TokenType.FLOW_MAPPING_END ||
446 (token.type == TokenType.SCALAR && token.style.isQuoted)) { 446 (token.type == TokenType.SCALAR &&
447 (token as ScalarToken).style.isQuoted)) {
447 _fetchValue(); 448 _fetchValue();
448 return; 449 return;
449 } 450 }
450 } 451 }
451 452
452 if (_isPlainCharAt(1)) { 453 if (_isPlainCharAt(1)) {
453 _fetchPlainScalar(); 454 _fetchPlainScalar();
454 } else { 455 } else {
455 _fetchValue(); 456 _fetchValue();
456 } 457 }
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 1675
1675 /// All trailing whitespace is preserved. 1676 /// All trailing whitespace is preserved.
1676 static const KEEP = const _Chomping("KEEP"); 1677 static const KEEP = const _Chomping("KEEP");
1677 1678
1678 final String name; 1679 final String name;
1679 1680
1680 const _Chomping(this.name); 1681 const _Chomping(this.name);
1681 1682
1682 String toString() => name; 1683 String toString() => name;
1683 } 1684 }
OLDNEW
« 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