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

Side by Side Diff: pkg/analyzer/lib/src/summary/inspect.dart

Issue 1914073003: Add a "raw" mode to the summary inspector (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/inspect.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/inspect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698