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

Side by Side Diff: utils/template/world.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « utils/template/tokenkind.dart ('k') | utils/tests/string_encoding/benchmark_runner.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 /** The one true [World]. */ 5 /** The one true [World]. */
6 World world; 6 World world;
7 7
8 typedef void MessageHandler(String prefix, String message, SourceSpan span); 8 typedef void MessageHandler(String prefix, String message, SourceSpan span);
9 typedef void PrintHandler(String message); 9 typedef void PrintHandler(String message);
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 * [message] at [location] will tell the user about what the compiler 144 * [message] at [location] will tell the user about what the compiler
145 * is doing. 145 * is doing.
146 */ 146 */
147 void info(String message, 147 void info(String message,
148 [SourceSpan span, SourceSpan span1, SourceSpan span2]) { 148 [SourceSpan span, SourceSpan span1, SourceSpan span2]) {
149 if (options.showInfo) { 149 if (options.showInfo) {
150 _message(_GREEN_COLOR, 'info: ', message, span, span1, span2, false); 150 _message(_GREEN_COLOR, 'info: ', message, span, span1, span2, false);
151 } 151 }
152 } 152 }
153 153
154 bool get hasErrors() => errors > 0; 154 bool get hasErrors => errors > 0;
155 155
156 withTiming(String name, f()) { 156 withTiming(String name, f()) {
157 final sw = new Stopwatch(); 157 final sw = new Stopwatch();
158 sw.start(); 158 sw.start();
159 var result = f(); 159 var result = f();
160 sw.stop(); 160 sw.stop();
161 info('$name in ${sw.elapsedInMs()}msec'); 161 info('$name in ${sw.elapsedInMs()}msec');
162 return result; 162 return result;
163 } 163 }
164 } 164 }
165 165
166 String _GREEN_COLOR = '\u001b[32m'; 166 String _GREEN_COLOR = '\u001b[32m';
167 String _RED_COLOR = '\u001b[31m'; 167 String _RED_COLOR = '\u001b[31m';
168 String _MAGENTA_COLOR = '\u001b[35m'; 168 String _MAGENTA_COLOR = '\u001b[35m';
169 String _NO_COLOR = '\u001b[0m'; 169 String _NO_COLOR = '\u001b[0m';
OLDNEW
« no previous file with comments | « utils/template/tokenkind.dart ('k') | utils/tests/string_encoding/benchmark_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698