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

Side by Side Diff: pkg/intl/lib/number_format.dart

Issue 22284003: pkg: analysis aided cleanup (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « pkg/intl/lib/message_lookup_by_library.dart ('k') | pkg/intl/lib/src/intl_helpers.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of intl; 5 part of intl;
6 /** 6 /**
7 * Provides the ability to format a number in a locale-specific way. The 7 * Provides the ability to format a number in a locale-specific way. The
8 * format is specified as a pattern using a subset of the ICU formatting 8 * format is specified as a pattern using a subset of the ICU formatting
9 * patterns. 9 * patterns.
10 * 10 *
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 /** 692 /**
693 * Return an iterator on the string as a list of substrings. 693 * Return an iterator on the string as a list of substrings.
694 */ 694 */
695 Iterator _iterator(String s) => new _StringIterator(s); 695 Iterator _iterator(String s) => new _StringIterator(s);
696 696
697 // TODO(nweiz): remove this when issue 3780 is fixed. 697 // TODO(nweiz): remove this when issue 3780 is fixed.
698 /** 698 /**
699 * Provides an Iterable that wraps [_iterator] so it can be used in a `for` 699 * Provides an Iterable that wraps [_iterator] so it can be used in a `for`
700 * loop. 700 * loop.
701 */ 701 */
702 class _StringIterable extends Iterable<String> { 702 class _StringIterable extends IterableBase<String> {
703 final Iterator<String> iterator; 703 final Iterator<String> iterator;
704 704
705 _StringIterable(String s) 705 _StringIterable(String s)
706 : iterator = _iterator(s); 706 : iterator = _iterator(s);
707 } 707 }
708 708
709 /** 709 /**
710 * Provides an iterator over a string as a list of substrings, and also 710 * Provides an iterator over a string as a list of substrings, and also
711 * gives us a lookahead of one via the [peek] method. 711 * gives us a lookahead of one via the [peek] method.
712 */ 712 */
713 class _StringIterator implements Iterator<String> { 713 class _StringIterator implements Iterator<String> {
714 String input; 714 String input;
715 var index = -1; 715 var index = -1;
716 inBounds(i) => i >= 0 && i < input.length; 716 inBounds(i) => i >= 0 && i < input.length;
717 _StringIterator(this.input); 717 _StringIterator(this.input);
718 String get current => inBounds(index) ? input[index] : null; 718 String get current => inBounds(index) ? input[index] : null;
719 719
720 bool moveNext() => inBounds(++index); 720 bool moveNext() => inBounds(++index);
721 String get peek => inBounds(index + 1) ? input[index + 1] : null; 721 String get peek => inBounds(index + 1) ? input[index + 1] : null;
722 Iterator<String> get iterator => this; 722 Iterator<String> get iterator => this;
723 } 723 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/message_lookup_by_library.dart ('k') | pkg/intl/lib/src/intl_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698