| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine; | 3 library engine; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'java_engine.dart'; | 5 import 'java_engine.dart'; |
| 6 import 'utilities_collection.dart'; | 6 import 'utilities_collection.dart'; |
| 7 import 'utilities_general.dart'; | 7 import 'utilities_general.dart'; |
| 8 import 'instrumentation.dart'; | 8 import 'instrumentation.dart'; |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'source.dart'; | 10 import 'source.dart'; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 */ | 94 */ |
| 95 Logger get logger => _logger; | 95 Logger get logger => _logger; |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * Set the logger that should receive information about errors within the anal
ysis engine to the | 98 * Set the logger that should receive information about errors within the anal
ysis engine to the |
| 99 * given logger. | 99 * given logger. |
| 100 * | 100 * |
| 101 * @param logger the logger that should receive information about errors withi
n the analysis | 101 * @param logger the logger that should receive information about errors withi
n the analysis |
| 102 * engine | 102 * engine |
| 103 */ | 103 */ |
| 104 void set logger(Logger logger2) { | 104 void set logger(Logger logger) { |
| 105 this._logger = logger2 == null ? Logger.NULL : logger2; | 105 this._logger = logger == null ? Logger.NULL : logger; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 /** | 108 /** |
| 109 * Container with statistics about the [AnalysisContext]. | 109 * Container with statistics about the [AnalysisContext]. |
| 110 */ | 110 */ |
| 111 abstract class AnalysisContentStatistics { | 111 abstract class AnalysisContentStatistics { |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Return the exceptions that caused some entries to have a state of [CacheSta
te#ERROR]. | 114 * Return the exceptions that caused some entries to have a state of [CacheSta
te#ERROR]. |
| 115 * | 115 * |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) { | 1433 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) { |
| 1434 return _parsedUnitState; | 1434 return _parsedUnitState; |
| 1435 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) { | 1435 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) { |
| 1436 return _publicNamespaceState; | 1436 return _publicNamespaceState; |
| 1437 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) { | 1437 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) { |
| 1438 return _sourceKindState; | 1438 return _sourceKindState; |
| 1439 } else { | 1439 } else { |
| 1440 return super.getState(descriptor); | 1440 return super.getState(descriptor); |
| 1441 } | 1441 } |
| 1442 } | 1442 } |
| 1443 CacheState getState2(DataDescriptor descriptor, Source librarySource2) { | 1443 CacheState getState2(DataDescriptor descriptor, Source librarySource) { |
| 1444 DartEntryImpl_ResolutionState state = _resolutionState; | 1444 DartEntryImpl_ResolutionState state = _resolutionState; |
| 1445 while (state != null) { | 1445 while (state != null) { |
| 1446 if (librarySource2 == state._librarySource) { | 1446 if (librarySource == state._librarySource) { |
| 1447 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { | 1447 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { |
| 1448 return state._resolutionErrorsState; | 1448 return state._resolutionErrorsState; |
| 1449 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { | 1449 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { |
| 1450 return state._resolvedUnitState; | 1450 return state._resolvedUnitState; |
| 1451 } else if (identical(descriptor, DartEntry.HINTS)) { | 1451 } else if (identical(descriptor, DartEntry.HINTS)) { |
| 1452 return state._hintsState; | 1452 return state._hintsState; |
| 1453 } else { | 1453 } else { |
| 1454 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"
); | 1454 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"
); |
| 1455 } | 1455 } |
| 1456 } | 1456 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1481 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) { | 1481 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) { |
| 1482 _parsedUnitAccessed = true; | 1482 _parsedUnitAccessed = true; |
| 1483 return _parsedUnit as Object; | 1483 return _parsedUnit as Object; |
| 1484 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) { | 1484 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) { |
| 1485 return _publicNamespace as Object; | 1485 return _publicNamespace as Object; |
| 1486 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) { | 1486 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) { |
| 1487 return _sourceKind as Object; | 1487 return _sourceKind as Object; |
| 1488 } | 1488 } |
| 1489 return super.getValue(descriptor); | 1489 return super.getValue(descriptor); |
| 1490 } | 1490 } |
| 1491 Object getValue2(DataDescriptor descriptor, Source librarySource2) { | 1491 Object getValue2(DataDescriptor descriptor, Source librarySource) { |
| 1492 DartEntryImpl_ResolutionState state = _resolutionState; | 1492 DartEntryImpl_ResolutionState state = _resolutionState; |
| 1493 while (state != null) { | 1493 while (state != null) { |
| 1494 if (librarySource2 == state._librarySource) { | 1494 if (librarySource == state._librarySource) { |
| 1495 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { | 1495 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { |
| 1496 return state._resolutionErrors as Object; | 1496 return state._resolutionErrors as Object; |
| 1497 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { | 1497 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { |
| 1498 return state._resolvedUnit as Object; | 1498 return state._resolvedUnit as Object; |
| 1499 } else if (identical(descriptor, DartEntry.HINTS)) { | 1499 } else if (identical(descriptor, DartEntry.HINTS)) { |
| 1500 return state._hints as Object; | 1500 return state._hints as Object; |
| 1501 } else { | 1501 } else { |
| 1502 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"
); | 1502 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"
); |
| 1503 } | 1503 } |
| 1504 } | 1504 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 _resolutionState.recordResolutionNotInProcess(); | 1669 _resolutionState.recordResolutionNotInProcess(); |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 /** | 1672 /** |
| 1673 * Remove any resolution information associated with this compilation unit bei
ng part of the given | 1673 * Remove any resolution information associated with this compilation unit bei
ng part of the given |
| 1674 * library, presumably because it is no longer part of the library. | 1674 * library, presumably because it is no longer part of the library. |
| 1675 * | 1675 * |
| 1676 * @param librarySource the source of the defining compilation unit of the lib
rary that used to | 1676 * @param librarySource the source of the defining compilation unit of the lib
rary that used to |
| 1677 * contain this part but no longer does | 1677 * contain this part but no longer does |
| 1678 */ | 1678 */ |
| 1679 void removeResolution(Source librarySource2) { | 1679 void removeResolution(Source librarySource) { |
| 1680 if (librarySource2 != null) { | 1680 if (librarySource != null) { |
| 1681 if (librarySource2 == _resolutionState._librarySource) { | 1681 if (librarySource == _resolutionState._librarySource) { |
| 1682 if (_resolutionState._nextState == null) { | 1682 if (_resolutionState._nextState == null) { |
| 1683 _resolutionState.invalidateAllResolutionInformation(); | 1683 _resolutionState.invalidateAllResolutionInformation(); |
| 1684 } else { | 1684 } else { |
| 1685 _resolutionState = _resolutionState._nextState; | 1685 _resolutionState = _resolutionState._nextState; |
| 1686 } | 1686 } |
| 1687 } else { | 1687 } else { |
| 1688 DartEntryImpl_ResolutionState priorState = _resolutionState; | 1688 DartEntryImpl_ResolutionState priorState = _resolutionState; |
| 1689 DartEntryImpl_ResolutionState state = _resolutionState._nextState; | 1689 DartEntryImpl_ResolutionState state = _resolutionState._nextState; |
| 1690 while (state != null) { | 1690 while (state != null) { |
| 1691 if (librarySource2 == state._librarySource) { | 1691 if (librarySource == state._librarySource) { |
| 1692 priorState._nextState = state._nextState; | 1692 priorState._nextState = state._nextState; |
| 1693 break; | 1693 break; |
| 1694 } | 1694 } |
| 1695 priorState = state; | 1695 priorState = state; |
| 1696 state = state._nextState; | 1696 state = state._nextState; |
| 1697 } | 1697 } |
| 1698 } | 1698 } |
| 1699 } | 1699 } |
| 1700 } | 1700 } |
| 1701 | 1701 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 builder.append(_launchableState); | 1897 builder.append(_launchableState); |
| 1898 _resolutionState.writeOn(builder); | 1898 _resolutionState.writeOn(builder); |
| 1899 } | 1899 } |
| 1900 | 1900 |
| 1901 /** | 1901 /** |
| 1902 * Return a resolution state for the specified library, creating one as necess
ary. | 1902 * Return a resolution state for the specified library, creating one as necess
ary. |
| 1903 * | 1903 * |
| 1904 * @param librarySource the library source (not `null`) | 1904 * @param librarySource the library source (not `null`) |
| 1905 * @return the resolution state (not `null`) | 1905 * @return the resolution state (not `null`) |
| 1906 */ | 1906 */ |
| 1907 DartEntryImpl_ResolutionState getOrCreateResolutionState(Source librarySource2
) { | 1907 DartEntryImpl_ResolutionState getOrCreateResolutionState(Source librarySource)
{ |
| 1908 DartEntryImpl_ResolutionState state = _resolutionState; | 1908 DartEntryImpl_ResolutionState state = _resolutionState; |
| 1909 if (state._librarySource == null) { | 1909 if (state._librarySource == null) { |
| 1910 state._librarySource = librarySource2; | 1910 state._librarySource = librarySource; |
| 1911 return state; | 1911 return state; |
| 1912 } | 1912 } |
| 1913 while (state._librarySource != librarySource2) { | 1913 while (state._librarySource != librarySource) { |
| 1914 if (state._nextState == null) { | 1914 if (state._nextState == null) { |
| 1915 DartEntryImpl_ResolutionState newState = new DartEntryImpl_ResolutionSta
te(); | 1915 DartEntryImpl_ResolutionState newState = new DartEntryImpl_ResolutionSta
te(); |
| 1916 newState._librarySource = librarySource2; | 1916 newState._librarySource = librarySource; |
| 1917 state._nextState = newState; | 1917 state._nextState = newState; |
| 1918 return newState; | 1918 return newState; |
| 1919 } | 1919 } |
| 1920 state = state._nextState; | 1920 state = state._nextState; |
| 1921 } | 1921 } |
| 1922 return state; | 1922 return state; |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 /** | 1925 /** |
| 1926 * Given that one of the flags is being transitioned to the given state, retur
n the value of the | 1926 * Given that one of the flags is being transitioned to the given state, retur
n the value of the |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"); | 2477 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"); |
| 2478 } | 2478 } |
| 2479 } | 2479 } |
| 2480 | 2480 |
| 2481 /** | 2481 /** |
| 2482 * Set the exception that caused one or more values to have a state of [CacheS
tate#ERROR] to | 2482 * Set the exception that caused one or more values to have a state of [CacheS
tate#ERROR] to |
| 2483 * the given exception. | 2483 * the given exception. |
| 2484 * | 2484 * |
| 2485 * @param exception the exception that caused one or more values to be uncompu
table | 2485 * @param exception the exception that caused one or more values to be uncompu
table |
| 2486 */ | 2486 */ |
| 2487 void set exception(AnalysisException exception2) { | 2487 void set exception(AnalysisException exception) { |
| 2488 this._exception = exception2; | 2488 this._exception = exception; |
| 2489 } | 2489 } |
| 2490 | 2490 |
| 2491 /** | 2491 /** |
| 2492 * Set the most recent time at which the state of the source matched the state
represented by this | 2492 * Set the most recent time at which the state of the source matched the state
represented by this |
| 2493 * entry to the given time. | 2493 * entry to the given time. |
| 2494 * | 2494 * |
| 2495 * @param time the new modification time of this entry | 2495 * @param time the new modification time of this entry |
| 2496 */ | 2496 */ |
| 2497 void set modificationTime(int time) { | 2497 void set modificationTime(int time) { |
| 2498 _modificationTime = time; | 2498 _modificationTime = time; |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3303 } | 3303 } |
| 3304 } | 3304 } |
| 3305 CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement libra
ry) { | 3305 CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement libra
ry) { |
| 3306 if (library == null) { | 3306 if (library == null) { |
| 3307 return null; | 3307 return null; |
| 3308 } | 3308 } |
| 3309 return resolveCompilationUnit2(unitSource, library.source); | 3309 return resolveCompilationUnit2(unitSource, library.source); |
| 3310 } | 3310 } |
| 3311 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) => getDartResolutionData2(unitSource, librarySource, DartEntry.RESOLVED_UNIT,
null); | 3311 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) => getDartResolutionData2(unitSource, librarySource, DartEntry.RESOLVED_UNIT,
null); |
| 3312 HtmlUnit resolveHtmlUnit(Source htmlSource) => parseHtmlUnit(htmlSource); | 3312 HtmlUnit resolveHtmlUnit(Source htmlSource) => parseHtmlUnit(htmlSource); |
| 3313 void set analysisOptions(AnalysisOptions options2) { | 3313 void set analysisOptions(AnalysisOptions options) { |
| 3314 { | 3314 { |
| 3315 this._options = options2; | 3315 this._options = options; |
| 3316 invalidateAllResolutionInformation(); | 3316 invalidateAllResolutionInformation(); |
| 3317 } | 3317 } |
| 3318 } | 3318 } |
| 3319 void set analysisPriorityOrder(List<Source> sources) { | 3319 void set analysisPriorityOrder(List<Source> sources) { |
| 3320 { | 3320 { |
| 3321 if (sources == null || sources.isEmpty) { | 3321 if (sources == null || sources.isEmpty) { |
| 3322 _cache.priorityOrder = Source.EMPTY_ARRAY; | 3322 _cache.priorityOrder = Source.EMPTY_ARRAY; |
| 3323 } else { | 3323 } else { |
| 3324 while (sources.remove(null)) { | 3324 while (sources.remove(null)) { |
| 3325 } | 3325 } |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3981 return sourceEntry; | 3981 return sourceEntry; |
| 3982 } | 3982 } |
| 3983 } | 3983 } |
| 3984 | 3984 |
| 3985 /** | 3985 /** |
| 3986 * Return an array containing all of the sources known to this context that ha
ve the given kind. | 3986 * Return an array containing all of the sources known to this context that ha
ve the given kind. |
| 3987 * | 3987 * |
| 3988 * @param kind the kind of sources to be returned | 3988 * @param kind the kind of sources to be returned |
| 3989 * @return all of the sources known to this context that have the given kind | 3989 * @return all of the sources known to this context that have the given kind |
| 3990 */ | 3990 */ |
| 3991 List<Source> getSources(SourceKind kind2) { | 3991 List<Source> getSources(SourceKind kind) { |
| 3992 List<Source> sources = new List<Source>(); | 3992 List<Source> sources = new List<Source>(); |
| 3993 { | 3993 { |
| 3994 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 3994 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 3995 if (identical(entry.getValue().kind, kind2)) { | 3995 if (identical(entry.getValue().kind, kind)) { |
| 3996 sources.add(entry.getKey()); | 3996 sources.add(entry.getKey()); |
| 3997 } | 3997 } |
| 3998 } | 3998 } |
| 3999 } | 3999 } |
| 4000 return new List.from(sources); | 4000 return new List.from(sources); |
| 4001 } | 4001 } |
| 4002 | 4002 |
| 4003 /** | 4003 /** |
| 4004 * Invalidate all of the resolution results computed by this context. | 4004 * Invalidate all of the resolution results computed by this context. |
| 4005 * | 4005 * |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4100 /** | 4100 /** |
| 4101 * Record the results produced by performing a [GenerateDartHintsTask]. If the
results were | 4101 * Record the results produced by performing a [GenerateDartHintsTask]. If the
results were |
| 4102 * computed from data that is now out-of-date, then the results will not be re
corded. | 4102 * computed from data that is now out-of-date, then the results will not be re
corded. |
| 4103 * | 4103 * |
| 4104 * @param task the task that was performed | 4104 * @param task the task that was performed |
| 4105 * @return an entry containing the computed results | 4105 * @return an entry containing the computed results |
| 4106 * @throws AnalysisException if the results could not be recorded | 4106 * @throws AnalysisException if the results could not be recorded |
| 4107 */ | 4107 */ |
| 4108 DartEntry recordGenerateDartHintsTask(GenerateDartHintsTask task) { | 4108 DartEntry recordGenerateDartHintsTask(GenerateDartHintsTask task) { |
| 4109 Source librarySource = task.libraryElement.source; | 4109 Source librarySource = task.libraryElement.source; |
| 4110 AnalysisException thrownException = task.thrownException; | 4110 AnalysisException thrownException = task.exception; |
| 4111 DartEntry libraryEntry = null; | 4111 DartEntry libraryEntry = null; |
| 4112 Map<Source, TimestampedData<List<AnalysisError>>> hintMap = task.hintMap; | 4112 Map<Source, TimestampedData<List<AnalysisError>>> hintMap = task.hintMap; |
| 4113 if (hintMap == null) { | 4113 if (hintMap == null) { |
| 4114 { | 4114 { |
| 4115 SourceEntry sourceEntry = _cache.get(librarySource); | 4115 SourceEntry sourceEntry = _cache.get(librarySource); |
| 4116 if (sourceEntry is! DartEntry) { | 4116 if (sourceEntry is! DartEntry) { |
| 4117 throw new AnalysisException.con1("Internal error: attempting to genera
te hints for non-Dart file as a Dart file: ${librarySource.fullName}"); | 4117 throw new AnalysisException.con1("Internal error: attempting to genera
te hints for non-Dart file as a Dart file: ${librarySource.fullName}"); |
| 4118 } | 4118 } |
| 4119 if (thrownException == null) { | 4119 if (thrownException == null) { |
| 4120 thrownException = new AnalysisException.con1("GenerateDartHintsTask re
turned a null hint map without throwing an exception: ${librarySource.fullName}"
); | 4120 thrownException = new AnalysisException.con1("GenerateDartHintsTask re
turned a null hint map without throwing an exception: ${librarySource.fullName}"
); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4184 /** | 4184 /** |
| 4185 * Record the results produced by performing a [ParseDartTask]. If the results
were computed | 4185 * Record the results produced by performing a [ParseDartTask]. If the results
were computed |
| 4186 * from data that is now out-of-date, then the results will not be recorded. | 4186 * from data that is now out-of-date, then the results will not be recorded. |
| 4187 * | 4187 * |
| 4188 * @param task the task that was performed | 4188 * @param task the task that was performed |
| 4189 * @return an entry containing the computed results | 4189 * @return an entry containing the computed results |
| 4190 * @throws AnalysisException if the results could not be recorded | 4190 * @throws AnalysisException if the results could not be recorded |
| 4191 */ | 4191 */ |
| 4192 DartEntry recordParseDartTaskResults(ParseDartTask task) { | 4192 DartEntry recordParseDartTaskResults(ParseDartTask task) { |
| 4193 Source source = task.source; | 4193 Source source = task.source; |
| 4194 AnalysisException thrownException = task.thrownException; | 4194 AnalysisException thrownException = task.exception; |
| 4195 DartEntry dartEntry = null; | 4195 DartEntry dartEntry = null; |
| 4196 { | 4196 { |
| 4197 SourceEntry sourceEntry = _cache.get(source); | 4197 SourceEntry sourceEntry = _cache.get(source); |
| 4198 if (sourceEntry is! DartEntry) { | 4198 if (sourceEntry is! DartEntry) { |
| 4199 throw new AnalysisException.con1("Internal error: attempting to parse no
n-Dart file as a Dart file: ${source.fullName}"); | 4199 throw new AnalysisException.con1("Internal error: attempting to parse no
n-Dart file as a Dart file: ${source.fullName}"); |
| 4200 } | 4200 } |
| 4201 dartEntry = sourceEntry as DartEntry; | 4201 dartEntry = sourceEntry as DartEntry; |
| 4202 _cache.accessed(source); | 4202 _cache.accessed(source); |
| 4203 int sourceTime = source.modificationStamp; | 4203 int sourceTime = source.modificationStamp; |
| 4204 int resultTime = task.modificationTime; | 4204 int resultTime = task.modificationTime; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4251 /** | 4251 /** |
| 4252 * Record the results produced by performing a [ParseHtmlTask]. If the results
were computed | 4252 * Record the results produced by performing a [ParseHtmlTask]. If the results
were computed |
| 4253 * from data that is now out-of-date, then the results will not be recorded. | 4253 * from data that is now out-of-date, then the results will not be recorded. |
| 4254 * | 4254 * |
| 4255 * @param task the task that was performed | 4255 * @param task the task that was performed |
| 4256 * @return an entry containing the computed results | 4256 * @return an entry containing the computed results |
| 4257 * @throws AnalysisException if the results could not be recorded | 4257 * @throws AnalysisException if the results could not be recorded |
| 4258 */ | 4258 */ |
| 4259 HtmlEntry recordParseHtmlTaskResults(ParseHtmlTask task) { | 4259 HtmlEntry recordParseHtmlTaskResults(ParseHtmlTask task) { |
| 4260 Source source = task.source; | 4260 Source source = task.source; |
| 4261 AnalysisException thrownException = task.thrownException; | 4261 AnalysisException thrownException = task.exception; |
| 4262 HtmlEntry htmlEntry = null; | 4262 HtmlEntry htmlEntry = null; |
| 4263 { | 4263 { |
| 4264 SourceEntry sourceEntry = _cache.get(source); | 4264 SourceEntry sourceEntry = _cache.get(source); |
| 4265 if (sourceEntry is! HtmlEntry) { | 4265 if (sourceEntry is! HtmlEntry) { |
| 4266 throw new AnalysisException.con1("Internal error: attempting to parse no
n-HTML file as a HTML file: ${source.fullName}"); | 4266 throw new AnalysisException.con1("Internal error: attempting to parse no
n-HTML file as a HTML file: ${source.fullName}"); |
| 4267 } | 4267 } |
| 4268 htmlEntry = sourceEntry as HtmlEntry; | 4268 htmlEntry = sourceEntry as HtmlEntry; |
| 4269 _cache.accessed(source); | 4269 _cache.accessed(source); |
| 4270 int sourceTime = source.modificationStamp; | 4270 int sourceTime = source.modificationStamp; |
| 4271 int resultTime = task.modificationTime; | 4271 int resultTime = task.modificationTime; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4325 /** | 4325 /** |
| 4326 * Record the results produced by performing a [ResolveDartLibraryTask]. If th
e results were | 4326 * Record the results produced by performing a [ResolveDartLibraryTask]. If th
e results were |
| 4327 * computed from data that is now out-of-date, then the results will not be re
corded. | 4327 * computed from data that is now out-of-date, then the results will not be re
corded. |
| 4328 * | 4328 * |
| 4329 * @param task the task that was performed | 4329 * @param task the task that was performed |
| 4330 * @return an entry containing the computed results | 4330 * @return an entry containing the computed results |
| 4331 * @throws AnalysisException if the results could not be recorded | 4331 * @throws AnalysisException if the results could not be recorded |
| 4332 */ | 4332 */ |
| 4333 DartEntry recordResolveDartLibraryTaskResults(ResolveDartLibraryTask task) { | 4333 DartEntry recordResolveDartLibraryTaskResults(ResolveDartLibraryTask task) { |
| 4334 LibraryResolver resolver = task.libraryResolver; | 4334 LibraryResolver resolver = task.libraryResolver; |
| 4335 AnalysisException thrownException = task.thrownException; | 4335 AnalysisException thrownException = task.exception; |
| 4336 DartEntry unitEntry = null; | 4336 DartEntry unitEntry = null; |
| 4337 Source unitSource = task.unitSource; | 4337 Source unitSource = task.unitSource; |
| 4338 if (resolver != null) { | 4338 if (resolver != null) { |
| 4339 { | 4339 { |
| 4340 if (allModificationTimesMatch(resolver)) { | 4340 if (allModificationTimesMatch(resolver)) { |
| 4341 Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML); | 4341 Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML); |
| 4342 RecordingErrorListener errorListener = resolver.errorListener; | 4342 RecordingErrorListener errorListener = resolver.errorListener; |
| 4343 for (Library library in resolver.resolvedLibraries) { | 4343 for (Library library in resolver.resolvedLibraries) { |
| 4344 Source librarySource = library.librarySource; | 4344 Source librarySource = library.librarySource; |
| 4345 for (Source source in library.compilationUnitSources) { | 4345 for (Source source in library.compilationUnitSources) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4417 * Record the results produced by performing a [ResolveDartUnitTask]. If the r
esults were | 4417 * Record the results produced by performing a [ResolveDartUnitTask]. If the r
esults were |
| 4418 * computed from data that is now out-of-date, then the results will not be re
corded. | 4418 * computed from data that is now out-of-date, then the results will not be re
corded. |
| 4419 * | 4419 * |
| 4420 * @param task the task that was performed | 4420 * @param task the task that was performed |
| 4421 * @return an entry containing the computed results | 4421 * @return an entry containing the computed results |
| 4422 * @throws AnalysisException if the results could not be recorded | 4422 * @throws AnalysisException if the results could not be recorded |
| 4423 */ | 4423 */ |
| 4424 SourceEntry recordResolveDartUnitTaskResults(ResolveDartUnitTask task) { | 4424 SourceEntry recordResolveDartUnitTaskResults(ResolveDartUnitTask task) { |
| 4425 Source unitSource = task.source; | 4425 Source unitSource = task.source; |
| 4426 Source librarySource = task.librarySource; | 4426 Source librarySource = task.librarySource; |
| 4427 AnalysisException thrownException = task.thrownException; | 4427 AnalysisException thrownException = task.exception; |
| 4428 DartEntry dartEntry = null; | 4428 DartEntry dartEntry = null; |
| 4429 { | 4429 { |
| 4430 SourceEntry sourceEntry = _cache.get(unitSource); | 4430 SourceEntry sourceEntry = _cache.get(unitSource); |
| 4431 if (sourceEntry is! DartEntry) { | 4431 if (sourceEntry is! DartEntry) { |
| 4432 throw new AnalysisException.con1("Internal error: attempting to reolve n
on-Dart file as a Dart file: ${unitSource.fullName}"); | 4432 throw new AnalysisException.con1("Internal error: attempting to reolve n
on-Dart file as a Dart file: ${unitSource.fullName}"); |
| 4433 } | 4433 } |
| 4434 dartEntry = sourceEntry as DartEntry; | 4434 dartEntry = sourceEntry as DartEntry; |
| 4435 _cache.accessed(unitSource); | 4435 _cache.accessed(unitSource); |
| 4436 int sourceTime = unitSource.modificationStamp; | 4436 int sourceTime = unitSource.modificationStamp; |
| 4437 int resultTime = task.modificationTime; | 4437 int resultTime = task.modificationTime; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4475 /** | 4475 /** |
| 4476 * Record the results produced by performing a [ResolveHtmlTask]. If the resul
ts were | 4476 * Record the results produced by performing a [ResolveHtmlTask]. If the resul
ts were |
| 4477 * computed from data that is now out-of-date, then the results will not be re
corded. | 4477 * computed from data that is now out-of-date, then the results will not be re
corded. |
| 4478 * | 4478 * |
| 4479 * @param task the task that was performed | 4479 * @param task the task that was performed |
| 4480 * @return an entry containing the computed results | 4480 * @return an entry containing the computed results |
| 4481 * @throws AnalysisException if the results could not be recorded | 4481 * @throws AnalysisException if the results could not be recorded |
| 4482 */ | 4482 */ |
| 4483 SourceEntry recordResolveHtmlTaskResults(ResolveHtmlTask task) { | 4483 SourceEntry recordResolveHtmlTaskResults(ResolveHtmlTask task) { |
| 4484 Source source = task.source; | 4484 Source source = task.source; |
| 4485 AnalysisException thrownException = task.thrownException; | 4485 AnalysisException thrownException = task.exception; |
| 4486 HtmlEntry htmlEntry = null; | 4486 HtmlEntry htmlEntry = null; |
| 4487 { | 4487 { |
| 4488 SourceEntry sourceEntry = _cache.get(source); | 4488 SourceEntry sourceEntry = _cache.get(source); |
| 4489 if (sourceEntry is! HtmlEntry) { | 4489 if (sourceEntry is! HtmlEntry) { |
| 4490 throw new AnalysisException.con1("Internal error: attempting to reolve n
on-HTML file as an HTML file: ${source.fullName}"); | 4490 throw new AnalysisException.con1("Internal error: attempting to reolve n
on-HTML file as an HTML file: ${source.fullName}"); |
| 4491 } | 4491 } |
| 4492 htmlEntry = sourceEntry as HtmlEntry; | 4492 htmlEntry = sourceEntry as HtmlEntry; |
| 4493 _cache.accessed(source); | 4493 _cache.accessed(source); |
| 4494 int sourceTime = source.modificationStamp; | 4494 int sourceTime = source.modificationStamp; |
| 4495 int resultTime = task.modificationTime; | 4495 int resultTime = task.modificationTime; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4698 void set dart2jsHint(bool dart2jsHints) { | 4698 void set dart2jsHint(bool dart2jsHints) { |
| 4699 this._dart2jsHint = dart2jsHints; | 4699 this._dart2jsHint = dart2jsHints; |
| 4700 } | 4700 } |
| 4701 | 4701 |
| 4702 /** | 4702 /** |
| 4703 * Set whether analysis is to generate hint results (e.g. type inference based
information and pub | 4703 * Set whether analysis is to generate hint results (e.g. type inference based
information and pub |
| 4704 * best practices). | 4704 * best practices). |
| 4705 * | 4705 * |
| 4706 * @param hint `true` if analysis is to generate hint results | 4706 * @param hint `true` if analysis is to generate hint results |
| 4707 */ | 4707 */ |
| 4708 void set hint(bool hint2) { | 4708 void set hint(bool hint) { |
| 4709 this._hint = hint2; | 4709 this._hint = hint; |
| 4710 } | 4710 } |
| 4711 | 4711 |
| 4712 /** | 4712 /** |
| 4713 * Set whether analysis is to use strict mode to the given value. In strict mo
de, error reporting | 4713 * Set whether analysis is to use strict mode to the given value. In strict mo
de, error reporting |
| 4714 * is based exclusively on the static type information. | 4714 * is based exclusively on the static type information. |
| 4715 * | 4715 * |
| 4716 * @param isStrict `true` if analysis is to use strict mode | 4716 * @param isStrict `true` if analysis is to use strict mode |
| 4717 */ | 4717 */ |
| 4718 void set strictMode(bool isStrict) { | 4718 void set strictMode(bool isStrict) { |
| 4719 _strictMode = isStrict; | 4719 _strictMode = isStrict; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4792 * | 4792 * |
| 4793 * @return the source for which the result is being reported | 4793 * @return the source for which the result is being reported |
| 4794 */ | 4794 */ |
| 4795 Source get source => _source; | 4795 Source get source => _source; |
| 4796 | 4796 |
| 4797 /** | 4797 /** |
| 4798 * Set the fully resolved AST that changed as a result of the analysis to the
given AST. | 4798 * Set the fully resolved AST that changed as a result of the analysis to the
given AST. |
| 4799 * | 4799 * |
| 4800 * @param compilationUnit the fully resolved AST that changed as a result of t
he analysis | 4800 * @param compilationUnit the fully resolved AST that changed as a result of t
he analysis |
| 4801 */ | 4801 */ |
| 4802 void set compilationUnit(CompilationUnit compilationUnit2) { | 4802 void set compilationUnit(CompilationUnit compilationUnit) { |
| 4803 this._compilationUnit = compilationUnit2; | 4803 this._compilationUnit = compilationUnit; |
| 4804 } | 4804 } |
| 4805 | 4805 |
| 4806 /** | 4806 /** |
| 4807 * Set the errors that changed as a result of the analysis to the given errors
and set the line | 4807 * Set the errors that changed as a result of the analysis to the given errors
and set the line |
| 4808 * information to the given line information. | 4808 * information to the given line information. |
| 4809 * | 4809 * |
| 4810 * @param errors the errors that changed as a result of the analysis | 4810 * @param errors the errors that changed as a result of the analysis |
| 4811 * @param lineInfo the line information associated with the source | 4811 * @param lineInfo the line information associated with the source |
| 4812 */ | 4812 */ |
| 4813 void setErrors(List<AnalysisError> errors2, LineInfo lineInfo2) { | 4813 void setErrors(List<AnalysisError> errors, LineInfo lineInfo) { |
| 4814 this._errors = errors2; | 4814 this._errors = errors; |
| 4815 this._lineInfo = lineInfo2; | 4815 this._lineInfo = lineInfo; |
| 4816 } | 4816 } |
| 4817 } | 4817 } |
| 4818 /** | 4818 /** |
| 4819 * Instances of the class `DelegatingAnalysisContextImpl` extend [AnalysisContex
tImpl | 4819 * Instances of the class `DelegatingAnalysisContextImpl` extend [AnalysisContex
tImpl |
| 4820 ] to delegate sources to the appropriate analysis context. For instance, if the | 4820 ] to delegate sources to the appropriate analysis context. For instance, if the |
| 4821 * source is in a system library then the analysis context from the [DartSdk] is
used. | 4821 * source is in a system library then the analysis context from the [DartSdk] is
used. |
| 4822 * | 4822 * |
| 4823 * @coverage dart.engine | 4823 * @coverage dart.engine |
| 4824 */ | 4824 */ |
| 4825 class DelegatingAnalysisContextImpl extends AnalysisContextImpl { | 4825 class DelegatingAnalysisContextImpl extends AnalysisContextImpl { |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5925 | 5925 |
| 5926 /** | 5926 /** |
| 5927 * The context in which the task is to be performed. | 5927 * The context in which the task is to be performed. |
| 5928 */ | 5928 */ |
| 5929 InternalAnalysisContext context; | 5929 InternalAnalysisContext context; |
| 5930 | 5930 |
| 5931 /** | 5931 /** |
| 5932 * The exception that was thrown while performing this task, or `null` if the
task completed | 5932 * The exception that was thrown while performing this task, or `null` if the
task completed |
| 5933 * successfully. | 5933 * successfully. |
| 5934 */ | 5934 */ |
| 5935 AnalysisException thrownException; | 5935 AnalysisException exception; |
| 5936 | 5936 |
| 5937 /** | 5937 /** |
| 5938 * Initialize a newly created task to perform analysis within the given contex
t. | 5938 * Initialize a newly created task to perform analysis within the given contex
t. |
| 5939 * | 5939 * |
| 5940 * @param context the context in which the task is to be performed | 5940 * @param context the context in which the task is to be performed |
| 5941 */ | 5941 */ |
| 5942 AnalysisTask(InternalAnalysisContext context) { | 5942 AnalysisTask(InternalAnalysisContext context) { |
| 5943 this.context = context; | 5943 this.context = context; |
| 5944 } | 5944 } |
| 5945 | 5945 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5956 * Perform this analysis task and use the given visitor to visit this task aft
er it has completed. | 5956 * Perform this analysis task and use the given visitor to visit this task aft
er it has completed. |
| 5957 * | 5957 * |
| 5958 * @param visitor the visitor used to visit this task after it has completed | 5958 * @param visitor the visitor used to visit this task after it has completed |
| 5959 * @return the value returned by the visitor | 5959 * @return the value returned by the visitor |
| 5960 * @throws AnalysisException if the visitor throws the exception | 5960 * @throws AnalysisException if the visitor throws the exception |
| 5961 */ | 5961 */ |
| 5962 Object perform(AnalysisTaskVisitor visitor) { | 5962 Object perform(AnalysisTaskVisitor visitor) { |
| 5963 try { | 5963 try { |
| 5964 safelyPerform(); | 5964 safelyPerform(); |
| 5965 } on AnalysisException catch (exception) { | 5965 } on AnalysisException catch (exception) { |
| 5966 thrownException = exception; | 5966 this.exception = exception; |
| 5967 AnalysisEngine.instance.logger.logInformation2("Task failed: ${taskDescrip
tion}", exception); | 5967 AnalysisEngine.instance.logger.logInformation2("Task failed: ${taskDescrip
tion}", exception); |
| 5968 } | 5968 } |
| 5969 return accept(visitor); | 5969 return accept(visitor); |
| 5970 } | 5970 } |
| 5971 String toString() => taskDescription; | 5971 String toString() => taskDescription; |
| 5972 | 5972 |
| 5973 /** | 5973 /** |
| 5974 * Return a textual description of this task. | 5974 * Return a textual description of this task. |
| 5975 * | 5975 * |
| 5976 * @return a textual description of this task | 5976 * @return a textual description of this task |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6323 return Source.EMPTY_ARRAY; | 6323 return Source.EMPTY_ARRAY; |
| 6324 } | 6324 } |
| 6325 return new List.from(sources); | 6325 return new List.from(sources); |
| 6326 } | 6326 } |
| 6327 } | 6327 } |
| 6328 class Source_ContentReceiver_9 implements Source_ContentReceiver { | 6328 class Source_ContentReceiver_9 implements Source_ContentReceiver { |
| 6329 final ParseDartTask ParseDartTask_this; | 6329 final ParseDartTask ParseDartTask_this; |
| 6330 RecordingErrorListener errorListener; | 6330 RecordingErrorListener errorListener; |
| 6331 List<Token> token; | 6331 List<Token> token; |
| 6332 Source_ContentReceiver_9(this.ParseDartTask_this, this.errorListener, this.tok
en); | 6332 Source_ContentReceiver_9(this.ParseDartTask_this, this.errorListener, this.tok
en); |
| 6333 void accept(CharBuffer contents, int modificationTime2) { | 6333 void accept(CharBuffer contents, int modificationTime) { |
| 6334 ParseDartTask_this.modificationTime = modificationTime2; | 6334 ParseDartTask_this.modificationTime = modificationTime; |
| 6335 CharBufferScanner scanner = new CharBufferScanner(ParseDartTask_this.source,
contents, errorListener); | 6335 CharBufferScanner scanner = new CharBufferScanner(ParseDartTask_this.source,
contents, errorListener); |
| 6336 token[0] = scanner.tokenize(); | 6336 token[0] = scanner.tokenize(); |
| 6337 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); | 6337 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); |
| 6338 } | 6338 } |
| 6339 void accept2(String contents, int modificationTime2) { | 6339 void accept2(String contents, int modificationTime) { |
| 6340 ParseDartTask_this.modificationTime = modificationTime2; | 6340 ParseDartTask_this.modificationTime = modificationTime; |
| 6341 StringScanner scanner = new StringScanner(ParseDartTask_this.source, content
s, errorListener); | 6341 StringScanner scanner = new StringScanner(ParseDartTask_this.source, content
s, errorListener); |
| 6342 token[0] = scanner.tokenize(); | 6342 token[0] = scanner.tokenize(); |
| 6343 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); | 6343 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); |
| 6344 } | 6344 } |
| 6345 } | 6345 } |
| 6346 /** | 6346 /** |
| 6347 * Instances of the class `ParseHtmlTask` parse a specific source as an HTML fil
e. | 6347 * Instances of the class `ParseHtmlTask` parse a specific source as an HTML fil
e. |
| 6348 */ | 6348 */ |
| 6349 class ParseHtmlTask extends AnalysisTask { | 6349 class ParseHtmlTask extends AnalysisTask { |
| 6350 | 6350 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6732 } | 6732 } |
| 6733 void logError2(String message, Exception exception) { | 6733 void logError2(String message, Exception exception) { |
| 6734 } | 6734 } |
| 6735 void logError3(Exception exception) { | 6735 void logError3(Exception exception) { |
| 6736 } | 6736 } |
| 6737 void logInformation(String message) { | 6737 void logInformation(String message) { |
| 6738 } | 6738 } |
| 6739 void logInformation2(String message, Exception exception) { | 6739 void logInformation2(String message, Exception exception) { |
| 6740 } | 6740 } |
| 6741 } | 6741 } |
| OLD | NEW |