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

Side by Side Diff: frog/utils.dart

Issue 8823010: frog: life is better with colors :) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years 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 | « frog/source.dart ('k') | frog/world.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Collection<T> supports most of the ES 5 Array methods, but it's missing 5 // Collection<T> supports most of the ES 5 Array methods, but it's missing
6 // map and reduce. 6 // map and reduce.
7 7
8 // TODO(jmesserly): we might want a version of this that return an iterable, 8 // TODO(jmesserly): we might want a version of this that return an iterable,
9 // however JS, Python and Ruby versions are all eager. 9 // however JS, Python and Ruby versions are all eager.
10 List map(Iterable source, mapper(source)) { 10 List map(Iterable source, mapper(source)) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 final int length; 135 final int length;
136 int _index = 0; 136 int _index = 0;
137 FixedIterator(this.value, this.length); 137 FixedIterator(this.value, this.length);
138 138
139 bool hasNext() => _index < length; 139 bool hasNext() => _index < length;
140 E next() { 140 E next() {
141 _index++; 141 _index++;
142 return value; 142 return value;
143 } 143 }
144 } 144 }
145
146 // Color constants used for generating messages.
147 String _GREEN_COLOR = '\u001b[32m';
148 String _RED_COLOR = '\u001b[31m';
149 String _MAGENTA_COLOR = '\u001b[35m';
150 String _NO_COLOR = '\u001b[0m';
OLDNEW
« no previous file with comments | « frog/source.dart ('k') | frog/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698