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

Side by Side Diff: pkg/front_end/lib/src/base/instrumentation.dart

Issue 2846463003: Instrument analyzer's type analysis and run front_end inference tests. (Closed)
Patch Set: Updates. Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 'package:kernel/ast.dart'; 5 import 'package:kernel/ast.dart';
6 6
7 /// Interface providing the ability to record property/value pairs associated 7 /// Interface providing the ability to record property/value pairs associated
8 /// with source file locations. Intended to facilitate testing. 8 /// with source file locations. Intended to facilitate testing.
9 abstract class Instrumentation { 9 abstract class Instrumentation {
10 /// Records a property/value pair associated with the given URI and offset. 10 /// Records a property/value pair associated with the given URI and offset.
(...skipping 17 matching lines...) Expand all
28 28
29 /// Instance of [InstrumentationValue] describing a [DartType]. 29 /// Instance of [InstrumentationValue] describing a [DartType].
30 class InstrumentationValueForType extends InstrumentationValue { 30 class InstrumentationValueForType extends InstrumentationValue {
31 final DartType type; 31 final DartType type;
32 32
33 InstrumentationValueForType(this.type); 33 InstrumentationValueForType(this.type);
34 34
35 @override 35 @override
36 String toString() { 36 String toString() {
37 // Convert '→' to '->' because '→' doesn't show up in some terminals. 37 // Convert '→' to '->' because '→' doesn't show up in some terminals.
38 return type.toString().replaceAll('→', '->'); 38 // Remove prefixes that are used very often in tests.
39 return type
40 .toString()
41 .replaceAll('→', '->')
42 .replaceAll('dart.core::', '')
43 .replaceAll('dart.async::', '')
44 .replaceAll('test::', '');
39 } 45 }
40 } 46 }
41 47
42 /// Instance of [InstrumentationValue] which only matches the given literal 48 /// Instance of [InstrumentationValue] which only matches the given literal
43 /// string. 49 /// string.
44 class InstrumentationValueLiteral extends InstrumentationValue { 50 class InstrumentationValueLiteral extends InstrumentationValue {
45 final String value; 51 final String value;
46 52
47 const InstrumentationValueLiteral(this.value); 53 const InstrumentationValueLiteral(this.value);
48 54
49 @override 55 @override
50 String toString() => value; 56 String toString() => value;
51 } 57 }
OLDNEW
« no previous file with comments | « pkg/front_end/front_end.iml ('k') | pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698