| OLD | NEW |
| 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_experimental/src/generated/source.dart' show Source, So
urceRange; | 10 import 'package:analyzer/src/generated/source.dart' show Source, SourceRange; |
| 11 import 'package:analyzer_experimental/src/generated/ast.dart' show ASTNode; | 11 import 'package:analyzer/src/generated/ast.dart' show ASTNode; |
| 12 | 12 |
| 13 import 'utils.dart'; | 13 import 'utils.dart'; |
| 14 | 14 |
| 15 | 15 |
| 16 /// Contains information about the application. | 16 /// Contains information about the application. |
| 17 class AppInfo { | 17 class AppInfo { |
| 18 final nodeStack = new List<NodeInfo>(); | 18 final nodeStack = new List<NodeInfo>(); |
| 19 final units = new List<UnitInfo>(); | 19 final units = new List<UnitInfo>(); |
| 20 final pathToFile = new Map<String, UnitInfo>(); | 20 final pathToFile = new Map<String, UnitInfo>(); |
| 21 NodeInfo currentNode; | 21 NodeInfo currentNode; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |