| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.task.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| 11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
| 12 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 12 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
| 13 import 'package:analyzer/src/generated/error.dart'; | 13 import 'package:analyzer/src/generated/error.dart'; |
| 14 import 'package:analyzer/src/generated/error_verifier.dart'; | 14 import 'package:analyzer/src/generated/error_verifier.dart'; |
| 15 import 'package:analyzer/src/generated/java_engine.dart'; | 15 import 'package:analyzer/src/generated/java_engine.dart'; |
| 16 import 'package:analyzer/src/generated/parser.dart'; | 16 import 'package:analyzer/src/generated/parser.dart'; |
| 17 import 'package:analyzer/src/generated/resolver.dart'; | 17 import 'package:analyzer/src/generated/resolver.dart'; |
| 18 import 'package:analyzer/src/generated/scanner.dart'; | 18 import 'package:analyzer/src/generated/scanner.dart'; |
| 19 import 'package:analyzer/src/generated/sdk.dart'; | 19 import 'package:analyzer/src/generated/sdk.dart'; |
| 20 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
| 21 import 'package:analyzer/src/generated/utilities_general.dart'; | |
| 22 import 'package:analyzer/src/task/driver.dart'; | 21 import 'package:analyzer/src/task/driver.dart'; |
| 23 import 'package:analyzer/src/task/general.dart'; | 22 import 'package:analyzer/src/task/general.dart'; |
| 24 import 'package:analyzer/task/dart.dart'; | 23 import 'package:analyzer/task/dart.dart'; |
| 25 import 'package:analyzer/task/general.dart'; | 24 import 'package:analyzer/task/general.dart'; |
| 26 import 'package:analyzer/task/model.dart'; | 25 import 'package:analyzer/task/model.dart'; |
| 27 | 26 |
| 28 /** | 27 /** |
| 29 * The errors produced while resolving a library directives. | 28 * The errors produced while resolving a library directives. |
| 30 * | 29 * |
| 31 * The list will be empty if there were no errors, but will not be `null`. | 30 * The list will be empty if there were no errors, but will not be `null`. |
| (...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 * Create a [GenerateHintsTask] based on the given [target] in | 1889 * Create a [GenerateHintsTask] based on the given [target] in |
| 1891 * the given [context]. | 1890 * the given [context]. |
| 1892 */ | 1891 */ |
| 1893 static GenerateHintsTask createTask( | 1892 static GenerateHintsTask createTask( |
| 1894 AnalysisContext context, AnalysisTarget target) { | 1893 AnalysisContext context, AnalysisTarget target) { |
| 1895 return new GenerateHintsTask(context, target); | 1894 return new GenerateHintsTask(context, target); |
| 1896 } | 1895 } |
| 1897 } | 1896 } |
| 1898 | 1897 |
| 1899 /** | 1898 /** |
| 1900 * A pair of a library [Source] and a unit [Source] in this library. | |
| 1901 */ | |
| 1902 class LibraryUnitTarget implements AnalysisTarget { | |
| 1903 final Source library; | |
| 1904 final Source unit; | |
| 1905 | |
| 1906 LibraryUnitTarget(this.library, this.unit); | |
| 1907 | |
| 1908 @override | |
| 1909 int get hashCode { | |
| 1910 return JenkinsSmiHash.combine(library.hashCode, unit.hashCode); | |
| 1911 } | |
| 1912 | |
| 1913 @override | |
| 1914 Source get source => unit; | |
| 1915 | |
| 1916 @override | |
| 1917 bool operator ==(other) { | |
| 1918 return other is LibraryUnitTarget && | |
| 1919 other.library == library && | |
| 1920 other.unit == unit; | |
| 1921 } | |
| 1922 } | |
| 1923 | |
| 1924 /** | |
| 1925 * A task that parses the content of a Dart file, producing an AST structure. | 1899 * A task that parses the content of a Dart file, producing an AST structure. |
| 1926 */ | 1900 */ |
| 1927 class ParseDartTask extends SourceBasedAnalysisTask { | 1901 class ParseDartTask extends SourceBasedAnalysisTask { |
| 1928 /** | 1902 /** |
| 1929 * The name of the input whose value is the line information produced for the | 1903 * The name of the input whose value is the line information produced for the |
| 1930 * file. | 1904 * file. |
| 1931 */ | 1905 */ |
| 1932 static const String LINE_INFO_INPUT_NAME = 'LINE_INFO_INPUT_NAME'; | 1906 static const String LINE_INFO_INPUT_NAME = 'LINE_INFO_INPUT_NAME'; |
| 1933 | 1907 |
| 1934 /** | 1908 /** |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2605 @override | 2579 @override |
| 2606 bool moveNext() { | 2580 bool moveNext() { |
| 2607 if (_newSources.isEmpty) { | 2581 if (_newSources.isEmpty) { |
| 2608 return false; | 2582 return false; |
| 2609 } | 2583 } |
| 2610 currentTarget = _newSources.first; | 2584 currentTarget = _newSources.first; |
| 2611 _newSources.remove(currentTarget); | 2585 _newSources.remove(currentTarget); |
| 2612 return true; | 2586 return true; |
| 2613 } | 2587 } |
| 2614 } | 2588 } |
| OLD | NEW |