| 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/task/driver.dart'; | |
| 22 import 'package:analyzer/src/task/general.dart'; | 21 import 'package:analyzer/src/task/general.dart'; |
| 23 import 'package:analyzer/task/dart.dart'; | 22 import 'package:analyzer/task/dart.dart'; |
| 24 import 'package:analyzer/task/general.dart'; | 23 import 'package:analyzer/task/general.dart'; |
| 25 import 'package:analyzer/task/model.dart'; | 24 import 'package:analyzer/task/model.dart'; |
| 26 | 25 |
| 27 /** | 26 /** |
| 28 * The errors produced while resolving a library directives. | 27 * The errors produced while resolving a library directives. |
| 29 * | 28 * |
| 30 * The list will be empty if there were no errors, but will not be `null`. | 29 * The list will be empty if there were no errors, but will not be `null`. |
| 31 * | 30 * |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 void internalPerform() { | 1528 void internalPerform() { |
| 1530 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT); | 1529 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT); |
| 1531 LibraryElement asyncLibrary = getRequiredInput(ASYNC_INPUT); | 1530 LibraryElement asyncLibrary = getRequiredInput(ASYNC_INPUT); |
| 1532 Namespace coreNamespace = coreLibrary.publicNamespace; | 1531 Namespace coreNamespace = coreLibrary.publicNamespace; |
| 1533 Namespace asyncNamespace = asyncLibrary.publicNamespace; | 1532 Namespace asyncNamespace = asyncLibrary.publicNamespace; |
| 1534 // | 1533 // |
| 1535 // Record outputs. | 1534 // Record outputs. |
| 1536 // | 1535 // |
| 1537 TypeProvider typeProvider = | 1536 TypeProvider typeProvider = |
| 1538 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); | 1537 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); |
| 1539 (context as ExtendedAnalysisContext).typeProvider = typeProvider; | 1538 (context as InternalAnalysisContext).typeProvider = typeProvider; |
| 1540 outputs[TYPE_PROVIDER] = typeProvider; | 1539 outputs[TYPE_PROVIDER] = typeProvider; |
| 1541 } | 1540 } |
| 1542 | 1541 |
| 1543 static Map<String, TaskInput> buildInputs(AnalysisContextTarget target) { | 1542 static Map<String, TaskInput> buildInputs(AnalysisContextTarget target) { |
| 1544 SourceFactory sourceFactory = target.context.sourceFactory; | 1543 SourceFactory sourceFactory = target.context.sourceFactory; |
| 1545 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); | 1544 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); |
| 1546 Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC); | 1545 Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC); |
| 1547 return <String, TaskInput>{ | 1546 return <String, TaskInput>{ |
| 1548 CORE_INPUT: LIBRARY_ELEMENT3.of(coreSource), | 1547 CORE_INPUT: LIBRARY_ELEMENT3.of(coreSource), |
| 1549 ASYNC_INPUT: LIBRARY_ELEMENT3.of(asyncSource) | 1548 ASYNC_INPUT: LIBRARY_ELEMENT3.of(asyncSource) |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 @override | 2577 @override |
| 2579 bool moveNext() { | 2578 bool moveNext() { |
| 2580 if (_newSources.isEmpty) { | 2579 if (_newSources.isEmpty) { |
| 2581 return false; | 2580 return false; |
| 2582 } | 2581 } |
| 2583 currentTarget = _newSources.first; | 2582 currentTarget = _newSources.first; |
| 2584 _newSources.remove(currentTarget); | 2583 _newSources.remove(currentTarget); |
| 2585 return true; | 2584 return true; |
| 2586 } | 2585 } |
| 2587 } | 2586 } |
| OLD | NEW |