| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 import 'dart:mirrors'; | 6 import 'dart:mirrors'; |
| 7 | 7 |
| 8 import 'package:analyzer/src/generated/utilities_dart.dart'; | 8 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 9 import 'package:analyzer/src/summary/base.dart'; | 9 import 'package:analyzer/src/summary/base.dart'; |
| 10 import 'package:analyzer/src/summary/format.dart'; | 10 import 'package:analyzer/src/summary/format.dart'; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 * The dependencies of the library currently being visited. | 148 * The dependencies of the library currently being visited. |
| 149 */ | 149 */ |
| 150 List<LinkedDependency> _dependencies; | 150 List<LinkedDependency> _dependencies; |
| 151 | 151 |
| 152 /** | 152 /** |
| 153 * The references of the unit currently being visited. | 153 * The references of the unit currently being visited. |
| 154 */ | 154 */ |
| 155 List<ReferenceWrapper> _references; | 155 List<ReferenceWrapper> _references; |
| 156 | 156 |
| 157 /** | 157 /** |
| 158 * Indicates whether summary inspection should operate in "raw" mode. In this |
| 159 * mode, the structure of the summary file is not altered for easier |
| 160 * readability; everything is output in exactly the form in which it appears |
| 161 * in the file. |
| 162 */ |
| 163 final bool raw; |
| 164 |
| 165 SummaryInspector(this.raw); |
| 166 |
| 167 /** |
| 158 * Decode the object [obj], which was reached by examining [key] inside | 168 * Decode the object [obj], which was reached by examining [key] inside |
| 159 * another object. | 169 * another object. |
| 160 */ | 170 */ |
| 161 DecodedEntity decode(Object obj, String key) { | 171 DecodedEntity decode(Object obj, String key) { |
| 162 if (obj is PackageBundle) { | 172 if (!raw && obj is PackageBundle) { |
| 163 return decodePackageBundle(obj); | 173 return decodePackageBundle(obj); |
| 164 } | 174 } |
| 165 if (obj is LibraryWrapper) { | 175 if (obj is LibraryWrapper) { |
| 166 return decodeLibrary(obj); | 176 return decodeLibrary(obj); |
| 167 } | 177 } |
| 168 if (obj is UnitWrapper) { | 178 if (obj is UnitWrapper) { |
| 169 return decodeUnit(obj); | 179 return decodeUnit(obj); |
| 170 } | 180 } |
| 171 if (obj is ReferenceWrapper) { | 181 if (obj is ReferenceWrapper) { |
| 172 return decodeReference(obj); | 182 return decodeReference(obj); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 432 |
| 423 /** | 433 /** |
| 424 * Wrapper around a [LinkedUnit] and its corresponding [UnlinkedUnit]. | 434 * Wrapper around a [LinkedUnit] and its corresponding [UnlinkedUnit]. |
| 425 */ | 435 */ |
| 426 class UnitWrapper { | 436 class UnitWrapper { |
| 427 final LinkedUnit _linked; | 437 final LinkedUnit _linked; |
| 428 final UnlinkedUnit _unlinked; | 438 final UnlinkedUnit _unlinked; |
| 429 | 439 |
| 430 UnitWrapper(this._linked, this._unlinked); | 440 UnitWrapper(this._linked, this._unlinked); |
| 431 } | 441 } |
| OLD | NEW |