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

Side by Side Diff: pkg/csslib/lib/src/messages.dart

Issue 60983003: pkg/csslib: fixed analysis error, more cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 7 years, 1 month 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/csslib/lib/src/css_printer.dart ('k') | pkg/csslib/lib/src/tree.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 library csslib.src.messages; 5 library csslib.src.messages;
6 6
7 import 'package:logging/logging.dart' show Level; 7 import 'package:logging/logging.dart' show Level;
8 import 'package:source_maps/span.dart' show Span; 8 import 'package:source_maps/span.dart' show Span;
9 9
10 import 'options.dart'; 10 import 'options.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 output.write(message); 61 output.write(message);
62 } else { 62 } else {
63 output.write(span.getLocationMessage(message, useColors: colors, 63 output.write(span.getLocationMessage(message, useColors: colors,
64 color: levelColor)); 64 color: levelColor));
65 } 65 }
66 66
67 return output.toString(); 67 return output.toString();
68 } 68 }
69 } 69 }
70 70
71 typedef void PrintHandler(Object obj); 71 typedef void PrintHandler(Message obj);
72 72
73 /** 73 /**
74 * This class tracks and prints information, warnings, and errors emitted by the 74 * This class tracks and prints information, warnings, and errors emitted by the
75 * compiler. 75 * compiler.
76 */ 76 */
77 class Messages { 77 class Messages {
78 /** Called on every error. Set to blank function to supress printing. */ 78 /** Called on every error. Set to blank function to supress printing. */
79 final PrintHandler printHandler; 79 final PrintHandler printHandler;
80 80
81 final PreprocessorOptions options; 81 final PreprocessorOptions options;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 /** Merge [newMessages] to this message lsit. */ 120 /** Merge [newMessages] to this message lsit. */
121 void mergeMessages(Messages newMessages) { 121 void mergeMessages(Messages newMessages) {
122 messages.addAll(newMessages.messages); 122 messages.addAll(newMessages.messages);
123 newMessages.messages.where((message) => 123 newMessages.messages.where((message) =>
124 message.level.value == Level.SEVERE || options.verbose) 124 message.level.value == Level.SEVERE || options.verbose)
125 .forEach((message) { printHandler(message); }); 125 .forEach((message) { printHandler(message); });
126 } 126 }
127 } 127 }
OLDNEW
« no previous file with comments | « pkg/csslib/lib/src/css_printer.dart ('k') | pkg/csslib/lib/src/tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698