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

Side by Side Diff: pkg/analyzer/lib/src/services/runtime/coverage/models.dart

Issue 681003002: Replace ${name} with $name where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up also implementation Created 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// A library with code coverage models. 5 /// A library with code coverage models.
6 library runtime.coverage.model; 6 library runtime.coverage.model;
7 7
8 import 'dart:collection' show SplayTreeMap; 8 import 'dart:collection' show SplayTreeMap;
9 9
10 import 'package:analyzer/src/generated/source.dart' show Source, SourceRange; 10 import 'package:analyzer/src/generated/source.dart' show Source, SourceRange;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 sink.writeln('$prefix "children": {'); 82 sink.writeln('$prefix "children": {');
83 children.fold(null, (prev, child) { 83 children.fold(null, (prev, child) {
84 if (prev != null) sink.writeln(','); 84 if (prev != null) sink.writeln(',');
85 return child..write(sink, executedIds, '$prefix '); 85 return child..write(sink, executedIds, '$prefix ');
86 }); 86 });
87 sink.writeln(); 87 sink.writeln();
88 sink.writeln('$prefix }'); 88 sink.writeln('$prefix }');
89 } 89 }
90 // Print source and line ranges. 90 // Print source and line ranges.
91 if (children.isEmpty) { 91 if (children.isEmpty) {
92 sink.write('${prefix} "ranges": ['); 92 sink.write('$prefix "ranges": [');
93 var rangePrinter = new RangePrinter(unit, sink, executedIds); 93 var rangePrinter = new RangePrinter(unit, sink, executedIds);
94 idToRange.forEach(rangePrinter.handle); 94 idToRange.forEach(rangePrinter.handle);
95 rangePrinter.printRange(); 95 rangePrinter.printRange();
96 sink.writeln(']'); 96 sink.writeln(']');
97 } 97 }
98 // Close this node. 98 // Close this node.
99 sink.write('$prefix}'); 99 sink.write('$prefix}');
100 } 100 }
101 101
102 UnitInfo get unit => parent.unit; 102 UnitInfo get unit => parent.unit;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 : super(appInfo, null, 'unit', path) { 159 : super(appInfo, null, 'unit', path) {
160 lineOffsets = getLineOffsets(content); 160 lineOffsets = getLineOffsets(content);
161 } 161 }
162 162
163 UnitInfo get unit => this; 163 UnitInfo get unit => this;
164 164
165 int getLine(int offset) { 165 int getLine(int offset) {
166 return binarySearch(lineOffsets, (x) => x >= offset); 166 return binarySearch(lineOffsets, (x) => x >= offset);
167 } 167 }
168 } 168 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/formatter_impl.dart ('k') | pkg/analyzer/lib/src/services/runtime/log.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698