Chromium Code Reviews| Index: pkg/analyzer/lib/task/dart.dart |
| diff --git a/pkg/analyzer/lib/task/dart.dart b/pkg/analyzer/lib/task/dart.dart |
| index 819554965f0341d546e326401f689c42fc7d4585..42191a4aa0637b84e6c0cff5dc87c5d390911a27 100644 |
| --- a/pkg/analyzer/lib/task/dart.dart |
| +++ b/pkg/analyzer/lib/task/dart.dart |
| @@ -9,6 +9,7 @@ import 'package:analyzer/src/generated/element.dart'; |
| import 'package:analyzer/src/generated/error.dart'; |
| import 'package:analyzer/src/generated/scanner.dart'; |
| import 'package:analyzer/src/generated/source.dart'; |
| +import 'package:analyzer/src/generated/utilities_general.dart'; |
| import 'package:analyzer/task/model.dart'; |
| /** |
| @@ -120,3 +121,28 @@ final ResultDescriptor<Token> TOKEN_STREAM = |
| */ |
| final ListResultDescriptor<Source> UNITS = |
| new ListResultDescriptor<Source>('UNITS', Source.EMPTY_ARRAY); |
| + |
| +/** |
| + * A pair of a library [Source] and a unit [Source] in this library. |
|
Brian Wilkerson
2015/04/15 21:41:37
Perhaps:
A specific compilation unit in a specifi
scheglov
2015/04/15 23:27:51
Done.
|
| + */ |
| +class LibraryUnitTarget implements AnalysisTarget { |
|
Brian Wilkerson
2015/04/15 21:41:37
I'd prefer a more meaningful name, but I'm having
scheglov
2015/04/15 23:27:51
Done.
|
| + final Source library; |
|
Brian Wilkerson
2015/04/15 21:41:37
This needs a comment. Even something as simple as
scheglov
2015/04/15 23:27:51
Done.
|
| + final Source unit; |
|
Brian Wilkerson
2015/04/15 21:41:37
This needs a comment.
scheglov
2015/04/15 23:27:51
Done.
|
| + |
| + LibraryUnitTarget(this.library, this.unit); |
|
Brian Wilkerson
2015/04/15 21:41:37
This needs a comment.
scheglov
2015/04/15 23:27:51
Done.
|
| + |
| + @override |
| + int get hashCode { |
| + return JenkinsSmiHash.combine(library.hashCode, unit.hashCode); |
| + } |
| + |
| + @override |
| + Source get source => unit; |
| + |
| + @override |
| + bool operator ==(other) { |
| + return other is LibraryUnitTarget && |
| + other.library == library && |
| + other.unit == unit; |
| + } |
| +} |