| 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 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 } | 1589 } |
| 1590 // | 1590 // |
| 1591 // Try to get the existing LibraryElement. | 1591 // Try to get the existing LibraryElement. |
| 1592 // | 1592 // |
| 1593 LibraryElementImpl libraryElement; | 1593 LibraryElementImpl libraryElement; |
| 1594 { | 1594 { |
| 1595 InternalAnalysisContext internalContext = | 1595 InternalAnalysisContext internalContext = |
| 1596 context as InternalAnalysisContext; | 1596 context as InternalAnalysisContext; |
| 1597 AnalysisCache analysisCache = internalContext.analysisCache; | 1597 AnalysisCache analysisCache = internalContext.analysisCache; |
| 1598 CacheEntry cacheEntry = internalContext.getCacheEntry(target); | 1598 CacheEntry cacheEntry = internalContext.getCacheEntry(target); |
| 1599 libraryElement = analysisCache.getValue(target, LIBRARY_ELEMENT1) as Libra
ryElementImpl; | 1599 libraryElement = analysisCache.getValue(target, LIBRARY_ELEMENT1) |
| 1600 as LibraryElementImpl; |
| 1600 if (libraryElement == null && | 1601 if (libraryElement == null && |
| 1601 internalContext.aboutToComputeResult(cacheEntry, LIBRARY_ELEMENT1)) { | 1602 internalContext.aboutToComputeResult(cacheEntry, LIBRARY_ELEMENT1)) { |
| 1602 libraryElement = analysisCache.getValue(target, LIBRARY_ELEMENT1) as Lib
raryElementImpl; | 1603 libraryElement = analysisCache.getValue(target, LIBRARY_ELEMENT1) |
| 1604 as LibraryElementImpl; |
| 1603 } | 1605 } |
| 1604 } | 1606 } |
| 1605 // | 1607 // |
| 1606 // Create a new LibraryElement. | 1608 // Create a new LibraryElement. |
| 1607 // | 1609 // |
| 1608 if (libraryElement == null) { | 1610 if (libraryElement == null) { |
| 1609 libraryElement = | 1611 libraryElement = |
| 1610 new LibraryElementImpl.forNode(owningContext, libraryNameNode); | 1612 new LibraryElementImpl.forNode(owningContext, libraryNameNode); |
| 1611 libraryElement.synthetic = modificationTime < 0; | 1613 libraryElement.synthetic = modificationTime < 0; |
| 1612 libraryElement.definingCompilationUnit = definingCompilationUnitElement; | 1614 libraryElement.definingCompilationUnit = definingCompilationUnitElement; |
| (...skipping 4153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5766 // Prepare inputs. | 5768 // Prepare inputs. |
| 5767 // | 5769 // |
| 5768 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); | 5770 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); |
| 5769 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | 5771 CompilationUnit unit = getRequiredInput(UNIT_INPUT); |
| 5770 CompilationUnitElement unitElement = unit.element; | 5772 CompilationUnitElement unitElement = unit.element; |
| 5771 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | 5773 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); |
| 5772 // | 5774 // |
| 5773 // Resolve local variables. | 5775 // Resolve local variables. |
| 5774 // | 5776 // |
| 5775 RecordingErrorListener errorListener = new RecordingErrorListener(); | 5777 RecordingErrorListener errorListener = new RecordingErrorListener(); |
| 5776 Scope nameScope = new LibraryScope(libraryElement, errorListener); | 5778 Scope nameScope = new LibraryScope(libraryElement); |
| 5777 VariableResolverVisitor visitor = new VariableResolverVisitor( | 5779 VariableResolverVisitor visitor = new VariableResolverVisitor( |
| 5778 libraryElement, unitElement.source, typeProvider, errorListener, | 5780 libraryElement, unitElement.source, typeProvider, errorListener, |
| 5779 nameScope: nameScope); | 5781 nameScope: nameScope); |
| 5780 unit.accept(visitor); | 5782 unit.accept(visitor); |
| 5781 // | 5783 // |
| 5782 // Record outputs. | 5784 // Record outputs. |
| 5783 // | 5785 // |
| 5784 outputs[RESOLVED_UNIT6] = unit; | 5786 outputs[RESOLVED_UNIT6] = unit; |
| 5785 outputs[CREATED_RESOLVED_UNIT6] = true; | 5787 outputs[CREATED_RESOLVED_UNIT6] = true; |
| 5786 outputs[VARIABLE_REFERENCE_ERRORS] = | 5788 outputs[VARIABLE_REFERENCE_ERRORS] = |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6353 | 6355 |
| 6354 @override | 6356 @override |
| 6355 bool moveNext() { | 6357 bool moveNext() { |
| 6356 if (_newSources.isEmpty) { | 6358 if (_newSources.isEmpty) { |
| 6357 return false; | 6359 return false; |
| 6358 } | 6360 } |
| 6359 currentTarget = _newSources.removeLast(); | 6361 currentTarget = _newSources.removeLast(); |
| 6360 return true; | 6362 return true; |
| 6361 } | 6363 } |
| 6362 } | 6364 } |
| OLD | NEW |