OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Summary of error messages produced by a `SummaryReporter`. | 5 /// Summary of error messages produced by a `SummaryReporter`. |
6 library dev_compiler.src.summary; | 6 library dev_compiler.src.summary; |
7 | 7 |
8 import 'dart:collection' show HashSet; | 8 import 'dart:collection' show HashSet; |
9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
10 import 'package:analyzer/src/generated/source.dart' show Source; | 10 import 'package:analyzer/src/generated/source.dart' show Source; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 /// All messages collected for the library. | 97 /// All messages collected for the library. |
98 final List<MessageSummary> messages; | 98 final List<MessageSummary> messages; |
99 | 99 |
100 /// All parts of this library. Only used for computing _lines. | 100 /// All parts of this library. Only used for computing _lines. |
101 final _uris = new HashSet<Uri>(); | 101 final _uris = new HashSet<Uri>(); |
102 | 102 |
103 int _lines; | 103 int _lines; |
104 | 104 |
105 LibrarySummary(this.name, {List<MessageSummary> messages, lines}) | 105 LibrarySummary(this.name, {List<MessageSummary> messages, lines}) |
106 : messages = messages == null ? <MessageSummary>[] : messages, | 106 : messages = messages == null ? <MessageSummary>[] : messages, |
107 _lines = lines == null ? lines : 0; | 107 _lines = lines != null ? lines : 0; |
vsm
2015/07/16 23:56:39
oops!
| |
108 | 108 |
109 void clear() { | 109 void clear() { |
110 _uris.clear(); | 110 _uris.clear(); |
111 _lines = 0; | 111 _lines = 0; |
112 messages.clear(); | 112 messages.clear(); |
113 } | 113 } |
114 | 114 |
115 /// Total lines of code (including all parts of the library). | 115 /// Total lines of code (including all parts of the library). |
116 int get lines => _lines; | 116 int get lines => _lines; |
117 | 117 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 void visitHtml(HtmlSummary html) { | 244 void visitHtml(HtmlSummary html) { |
245 for (var msg in html.messages) { | 245 for (var msg in html.messages) { |
246 msg.accept(this); | 246 msg.accept(this); |
247 } | 247 } |
248 } | 248 } |
249 void visitMessage(MessageSummary message) {} | 249 void visitMessage(MessageSummary message) {} |
250 } | 250 } |
OLD | NEW |