OLD | NEW |
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 'package:csslib/parser.dart'; | |
11 | |
12 import 'options.dart'; | 10 import 'options.dart'; |
13 | 11 |
14 // TODO(terry): Remove the global messages, use some object that tracks | 12 // TODO(terry): Remove the global messages, use some object that tracks |
15 // compilation state. | 13 // compilation state. |
16 | 14 |
17 /** The global [Messages] for tracking info/warnings/messages. */ | 15 /** The global [Messages] for tracking info/warnings/messages. */ |
18 Messages messages; | 16 Messages messages; |
19 | 17 |
20 // Color constants used for generating messages. | 18 // Color constants used for generating messages. |
21 final String GREEN_COLOR = '\u001b[32m'; | 19 final String GREEN_COLOR = '\u001b[32m'; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 118 } |
121 | 119 |
122 /** Merge [newMessages] to this message lsit. */ | 120 /** Merge [newMessages] to this message lsit. */ |
123 void mergeMessages(Messages newMessages) { | 121 void mergeMessages(Messages newMessages) { |
124 messages.addAll(newMessages.messages); | 122 messages.addAll(newMessages.messages); |
125 newMessages.messages.where((message) => | 123 newMessages.messages.where((message) => |
126 message.level.value == Level.SEVERE || options.verbose) | 124 message.level.value == Level.SEVERE || options.verbose) |
127 .forEach((message) { printHandler(message); }); | 125 .forEach((message) { printHandler(message); }); |
128 } | 126 } |
129 } | 127 } |
OLD | NEW |