Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/engine.dart

Issue 23852002: java2dart improvements and new analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 'instrumentation.dart'; 7 import 'instrumentation.dart';
8 import 'error.dart'; 8 import 'error.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'scanner.dart' show Token, CharBufferScanner, StringScanner; 10 import 'scanner.dart' show Token, CharBufferScanner, StringScanner;
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 1080
1081 /** 1081 /**
1082 * Return the state of the data represented by the given descriptor in the con text of the given 1082 * Return the state of the data represented by the given descriptor in the con text of the given
1083 * library. 1083 * library.
1084 * 1084 *
1085 * @param descriptor the descriptor representing the data whose state is to be returned 1085 * @param descriptor the descriptor representing the data whose state is to be returned
1086 * @param librarySource the source of the defining compilation unit of the lib rary that is the 1086 * @param librarySource the source of the defining compilation unit of the lib rary that is the
1087 * context for the data 1087 * context for the data
1088 * @return the value of the data represented by the given descriptor and libra ry 1088 * @return the value of the data represented by the given descriptor and libra ry
1089 */ 1089 */
1090 CacheState getState2(DataDescriptor<Object> descriptor, Source librarySource); 1090 CacheState getState2(DataDescriptor descriptor, Source librarySource);
1091 1091
1092 /** 1092 /**
1093 * Return the value of the data represented by the given descriptor in the con text of the given 1093 * Return the value of the data represented by the given descriptor in the con text of the given
1094 * library, or `null` if the data represented by the descriptor is not in the cache. 1094 * library, or `null` if the data represented by the descriptor is not in the cache.
1095 * 1095 *
1096 * @param descriptor the descriptor representing which data is to be returned 1096 * @param descriptor the descriptor representing which data is to be returned
1097 * @param librarySource the source of the defining compilation unit of the lib rary that is the 1097 * @param librarySource the source of the defining compilation unit of the lib rary that is the
1098 * context for the data 1098 * context for the data
1099 * @return the value of the data represented by the given descriptor and libra ry 1099 * @return the value of the data represented by the given descriptor and libra ry
1100 */ 1100 */
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 DartEntryImpl_ResolutionState state = _resolutionState; 1303 DartEntryImpl_ResolutionState state = _resolutionState;
1304 while (state != null) { 1304 while (state != null) {
1305 if (identical(state._resolvedUnitState, CacheState.VALID)) { 1305 if (identical(state._resolvedUnitState, CacheState.VALID)) {
1306 return state._resolvedUnit.accept(new ASTCloner()) as CompilationUnit; 1306 return state._resolvedUnit.accept(new ASTCloner()) as CompilationUnit;
1307 } 1307 }
1308 state = state._nextState; 1308 state = state._nextState;
1309 } 1309 }
1310 ; 1310 ;
1311 return null; 1311 return null;
1312 } 1312 }
1313 CacheState getState(DataDescriptor<Object> descriptor) { 1313 CacheState getState(DataDescriptor descriptor) {
1314 if (identical(descriptor, DartEntry.ELEMENT)) { 1314 if (identical(descriptor, DartEntry.ELEMENT)) {
1315 return _elementState; 1315 return _elementState;
1316 } else if (identical(descriptor, DartEntry.EXPORTED_LIBRARIES)) { 1316 } else if (identical(descriptor, DartEntry.EXPORTED_LIBRARIES)) {
1317 return _exportedLibrariesState; 1317 return _exportedLibrariesState;
1318 } else if (identical(descriptor, DartEntry.IMPORTED_LIBRARIES)) { 1318 } else if (identical(descriptor, DartEntry.IMPORTED_LIBRARIES)) {
1319 return _importedLibrariesState; 1319 return _importedLibrariesState;
1320 } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) { 1320 } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
1321 return _includedPartsState; 1321 return _includedPartsState;
1322 } else if (identical(descriptor, DartEntry.IS_CLIENT)) { 1322 } else if (identical(descriptor, DartEntry.IS_CLIENT)) {
1323 return _clientServerState; 1323 return _clientServerState;
1324 } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) { 1324 } else if (identical(descriptor, DartEntry.IS_LAUNCHABLE)) {
1325 return _launchableState; 1325 return _launchableState;
1326 } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) { 1326 } else if (identical(descriptor, DartEntry.PARSE_ERRORS)) {
1327 return _parseErrorsState; 1327 return _parseErrorsState;
1328 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) { 1328 } else if (identical(descriptor, DartEntry.PARSED_UNIT)) {
1329 return _parsedUnitState; 1329 return _parsedUnitState;
1330 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) { 1330 } else if (identical(descriptor, DartEntry.PUBLIC_NAMESPACE)) {
1331 return _publicNamespaceState; 1331 return _publicNamespaceState;
1332 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) { 1332 } else if (identical(descriptor, DartEntry.SOURCE_KIND)) {
1333 return _sourceKindState; 1333 return _sourceKindState;
1334 } else { 1334 } else {
1335 return super.getState(descriptor); 1335 return super.getState(descriptor);
1336 } 1336 }
1337 } 1337 }
1338 CacheState getState2(DataDescriptor<Object> descriptor, Source librarySource2) { 1338 CacheState getState2(DataDescriptor descriptor, Source librarySource2) {
1339 DartEntryImpl_ResolutionState state = _resolutionState; 1339 DartEntryImpl_ResolutionState state = _resolutionState;
1340 while (state != null) { 1340 while (state != null) {
1341 if (librarySource2 == state._librarySource) { 1341 if (librarySource2 == state._librarySource) {
1342 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { 1342 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
1343 return _resolutionState._resolutionErrorsState; 1343 return _resolutionState._resolutionErrorsState;
1344 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { 1344 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
1345 return _resolutionState._resolvedUnitState; 1345 return _resolutionState._resolvedUnitState;
1346 } else if (identical(descriptor, DartEntry.HINTS)) { 1346 } else if (identical(descriptor, DartEntry.HINTS)) {
1347 return _resolutionState._hintsState; 1347 return _resolutionState._hintsState;
1348 } else { 1348 } else {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 if (_parsedUnitState != CacheState.VALID) { 1562 if (_parsedUnitState != CacheState.VALID) {
1563 _parsedUnit = unit; 1563 _parsedUnit = unit;
1564 _parsedUnitAccessed = false; 1564 _parsedUnitAccessed = false;
1565 _parsedUnitState = CacheState.VALID; 1565 _parsedUnitState = CacheState.VALID;
1566 } 1566 }
1567 if (_parseErrorsState != CacheState.VALID) { 1567 if (_parseErrorsState != CacheState.VALID) {
1568 _parseErrors = errors == null ? AnalysisError.NO_ERRORS : errors; 1568 _parseErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
1569 _parseErrorsState = CacheState.VALID; 1569 _parseErrorsState = CacheState.VALID;
1570 } 1570 }
1571 } 1571 }
1572 void setState(DataDescriptor<Object> descriptor, CacheState state) { 1572 void setState(DataDescriptor descriptor, CacheState state) {
1573 if (identical(descriptor, DartEntry.ELEMENT)) { 1573 if (identical(descriptor, DartEntry.ELEMENT)) {
1574 _element = updatedValue(state, _element, null); 1574 _element = updatedValue(state, _element, null);
1575 _elementState = state; 1575 _elementState = state;
1576 } else if (identical(descriptor, DartEntry.EXPORTED_LIBRARIES)) { 1576 } else if (identical(descriptor, DartEntry.EXPORTED_LIBRARIES)) {
1577 _exportedLibraries = updatedValue(state, _exportedLibraries, Source.EMPTY_ ARRAY); 1577 _exportedLibraries = updatedValue(state, _exportedLibraries, Source.EMPTY_ ARRAY);
1578 _exportedLibrariesState = state; 1578 _exportedLibrariesState = state;
1579 } else if (identical(descriptor, DartEntry.IMPORTED_LIBRARIES)) { 1579 } else if (identical(descriptor, DartEntry.IMPORTED_LIBRARIES)) {
1580 _importedLibraries = updatedValue(state, _importedLibraries, Source.EMPTY_ ARRAY); 1580 _importedLibraries = updatedValue(state, _importedLibraries, Source.EMPTY_ ARRAY);
1581 _importedLibrariesState = state; 1581 _importedLibrariesState = state;
1582 } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) { 1582 } else if (identical(descriptor, DartEntry.INCLUDED_PARTS)) {
(...skipping 28 matching lines...) Expand all
1611 1611
1612 /** 1612 /**
1613 * Set the state of the data represented by the given descriptor in the contex t of the given 1613 * Set the state of the data represented by the given descriptor in the contex t of the given
1614 * library to the given state. 1614 * library to the given state.
1615 * 1615 *
1616 * @param descriptor the descriptor representing the data whose state is to be set 1616 * @param descriptor the descriptor representing the data whose state is to be set
1617 * @param librarySource the source of the defining compilation unit of the lib rary that is the 1617 * @param librarySource the source of the defining compilation unit of the lib rary that is the
1618 * context for the data 1618 * context for the data
1619 * @param cacheState the new state of the data represented by the given descri ptor 1619 * @param cacheState the new state of the data represented by the given descri ptor
1620 */ 1620 */
1621 void setState2(DataDescriptor<Object> descriptor, Source librarySource, CacheS tate cacheState) { 1621 void setState2(DataDescriptor descriptor, Source librarySource, CacheState cac heState) {
1622 DartEntryImpl_ResolutionState state = getOrCreateResolutionState(librarySour ce); 1622 DartEntryImpl_ResolutionState state = getOrCreateResolutionState(librarySour ce);
1623 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) { 1623 if (identical(descriptor, DartEntry.RESOLUTION_ERRORS)) {
1624 state._resolutionErrors = updatedValue(cacheState, state._resolutionErrors , AnalysisError.NO_ERRORS); 1624 state._resolutionErrors = updatedValue(cacheState, state._resolutionErrors , AnalysisError.NO_ERRORS);
1625 state._resolutionErrorsState = cacheState; 1625 state._resolutionErrorsState = cacheState;
1626 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) { 1626 } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
1627 state._resolvedUnit = updatedValue(cacheState, state._resolvedUnit, null); 1627 state._resolvedUnit = updatedValue(cacheState, state._resolvedUnit, null);
1628 state._resolvedUnitState = cacheState; 1628 state._resolvedUnitState = cacheState;
1629 } else if (identical(descriptor, DartEntry.HINTS)) { 1629 } else if (identical(descriptor, DartEntry.HINTS)) {
1630 state._hints = updatedValue(cacheState, state._hints, AnalysisError.NO_ERR ORS); 1630 state._hints = updatedValue(cacheState, state._hints, AnalysisError.NO_ERR ORS);
1631 state._hintsState = cacheState; 1631 state._hintsState = cacheState;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 } 2057 }
2058 for (AnalysisError error in _hints) { 2058 for (AnalysisError error in _hints) {
2059 errors.add(error); 2059 errors.add(error);
2060 } 2060 }
2061 if (errors.length == 0) { 2061 if (errors.length == 0) {
2062 return AnalysisError.NO_ERRORS; 2062 return AnalysisError.NO_ERRORS;
2063 } 2063 }
2064 return new List.from(errors); 2064 return new List.from(errors);
2065 } 2065 }
2066 SourceKind get kind => SourceKind.HTML; 2066 SourceKind get kind => SourceKind.HTML;
2067 CacheState getState(DataDescriptor<Object> descriptor) { 2067 CacheState getState(DataDescriptor descriptor) {
2068 if (identical(descriptor, HtmlEntry.ELEMENT)) { 2068 if (identical(descriptor, HtmlEntry.ELEMENT)) {
2069 return _elementState; 2069 return _elementState;
2070 } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) { 2070 } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
2071 return _parsedUnitState; 2071 return _parsedUnitState;
2072 } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) { 2072 } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
2073 return _referencedLibrariesState; 2073 return _referencedLibrariesState;
2074 } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) { 2074 } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
2075 return _resolutionErrorsState; 2075 return _resolutionErrorsState;
2076 } else if (identical(descriptor, HtmlEntry.HINTS)) { 2076 } else if (identical(descriptor, HtmlEntry.HINTS)) {
2077 return _hintsState; 2077 return _hintsState;
(...skipping 24 matching lines...) Expand all
2102 * Invalidate all of the resolution information associated with the compilatio n unit. 2102 * Invalidate all of the resolution information associated with the compilatio n unit.
2103 */ 2103 */
2104 void invalidateAllResolutionInformation() { 2104 void invalidateAllResolutionInformation() {
2105 _element = null; 2105 _element = null;
2106 _elementState = CacheState.INVALID; 2106 _elementState = CacheState.INVALID;
2107 _resolutionErrors = AnalysisError.NO_ERRORS; 2107 _resolutionErrors = AnalysisError.NO_ERRORS;
2108 _resolutionErrorsState = CacheState.INVALID; 2108 _resolutionErrorsState = CacheState.INVALID;
2109 _hints = AnalysisError.NO_ERRORS; 2109 _hints = AnalysisError.NO_ERRORS;
2110 _hintsState = CacheState.INVALID; 2110 _hintsState = CacheState.INVALID;
2111 } 2111 }
2112 void setState(DataDescriptor<Object> descriptor, CacheState state) { 2112 void setState(DataDescriptor descriptor, CacheState state) {
2113 if (identical(descriptor, HtmlEntry.ELEMENT)) { 2113 if (identical(descriptor, HtmlEntry.ELEMENT)) {
2114 _element = updatedValue(state, _element, null); 2114 _element = updatedValue(state, _element, null);
2115 _elementState = state; 2115 _elementState = state;
2116 } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) { 2116 } else if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
2117 _parsedUnit = updatedValue(state, _parsedUnit, null); 2117 _parsedUnit = updatedValue(state, _parsedUnit, null);
2118 _parsedUnitState = state; 2118 _parsedUnitState = state;
2119 } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) { 2119 } else if (identical(descriptor, HtmlEntry.REFERENCED_LIBRARIES)) {
2120 _referencedLibraries = updatedValue(state, _referencedLibraries, Source.EM PTY_ARRAY); 2120 _referencedLibraries = updatedValue(state, _referencedLibraries, Source.EM PTY_ARRAY);
2121 _referencedLibrariesState = state; 2121 _referencedLibrariesState = state;
2122 } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) { 2122 } else if (identical(descriptor, HtmlEntry.RESOLUTION_ERRORS)) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
2206 * @return the modification time of this entry 2206 * @return the modification time of this entry
2207 */ 2207 */
2208 int get modificationTime; 2208 int get modificationTime;
2209 2209
2210 /** 2210 /**
2211 * Return the state of the data represented by the given descriptor. 2211 * Return the state of the data represented by the given descriptor.
2212 * 2212 *
2213 * @param descriptor the descriptor representing the data whose state is to be returned 2213 * @param descriptor the descriptor representing the data whose state is to be returned
2214 * @return the state of the data represented by the given descriptor 2214 * @return the state of the data represented by the given descriptor
2215 */ 2215 */
2216 CacheState getState(DataDescriptor<Object> descriptor); 2216 CacheState getState(DataDescriptor descriptor);
2217 2217
2218 /** 2218 /**
2219 * Return the value of the data represented by the given descriptor, or `null` if the data 2219 * Return the value of the data represented by the given descriptor, or `null` if the data
2220 * represented by the descriptor is not in the cache. 2220 * represented by the descriptor is not in the cache.
2221 * 2221 *
2222 * @param descriptor the descriptor representing which data is to be returned 2222 * @param descriptor the descriptor representing which data is to be returned
2223 * @return the value of the data represented by the given descriptor 2223 * @return the value of the data represented by the given descriptor
2224 */ 2224 */
2225 Object getValue(DataDescriptor descriptor); 2225 Object getValue(DataDescriptor descriptor);
2226 2226
(...skipping 23 matching lines...) Expand all
2250 * The state of the cached line information. 2250 * The state of the cached line information.
2251 */ 2251 */
2252 CacheState _lineInfoState = CacheState.INVALID; 2252 CacheState _lineInfoState = CacheState.INVALID;
2253 2253
2254 /** 2254 /**
2255 * The line information computed for the source, or `null` if the line informa tion is not 2255 * The line information computed for the source, or `null` if the line informa tion is not
2256 * currently cached. 2256 * currently cached.
2257 */ 2257 */
2258 LineInfo _lineInfo; 2258 LineInfo _lineInfo;
2259 int get modificationTime => _modificationTime; 2259 int get modificationTime => _modificationTime;
2260 CacheState getState(DataDescriptor<Object> descriptor) { 2260 CacheState getState(DataDescriptor descriptor) {
2261 if (identical(descriptor, SourceEntry.LINE_INFO)) { 2261 if (identical(descriptor, SourceEntry.LINE_INFO)) {
2262 return _lineInfoState; 2262 return _lineInfoState;
2263 } else { 2263 } else {
2264 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"); 2264 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
2265 } 2265 }
2266 } 2266 }
2267 Object getValue(DataDescriptor descriptor) { 2267 Object getValue(DataDescriptor descriptor) {
2268 if (identical(descriptor, SourceEntry.LINE_INFO)) { 2268 if (identical(descriptor, SourceEntry.LINE_INFO)) {
2269 return _lineInfo as Object; 2269 return _lineInfo as Object;
2270 } else { 2270 } else {
(...skipping 10 matching lines...) Expand all
2281 void set modificationTime(int time) { 2281 void set modificationTime(int time) {
2282 _modificationTime = time; 2282 _modificationTime = time;
2283 } 2283 }
2284 2284
2285 /** 2285 /**
2286 * Set the state of the data represented by the given descriptor to the given state. 2286 * Set the state of the data represented by the given descriptor to the given state.
2287 * 2287 *
2288 * @param descriptor the descriptor representing the data whose state is to be set 2288 * @param descriptor the descriptor representing the data whose state is to be set
2289 * @param the new state of the data represented by the given descriptor 2289 * @param the new state of the data represented by the given descriptor
2290 */ 2290 */
2291 void setState(DataDescriptor<Object> descriptor, CacheState state) { 2291 void setState(DataDescriptor descriptor, CacheState state) {
2292 if (identical(descriptor, SourceEntry.LINE_INFO)) { 2292 if (identical(descriptor, SourceEntry.LINE_INFO)) {
2293 _lineInfo = updatedValue(state, _lineInfo, null); 2293 _lineInfo = updatedValue(state, _lineInfo, null);
2294 _lineInfoState = state; 2294 _lineInfoState = state;
2295 } else { 2295 } else {
2296 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}"); 2296 throw new IllegalArgumentException("Invalid descriptor: ${descriptor}");
2297 } 2297 }
2298 } 2298 }
2299 2299
2300 /** 2300 /**
2301 * Set the value of the data represented by the given descriptor to the given value. 2301 * Set the value of the data represented by the given descriptor to the given value.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 } 2361 }
2362 /** 2362 /**
2363 * Implementation of the [AnalysisContentStatistics]. 2363 * Implementation of the [AnalysisContentStatistics].
2364 */ 2364 */
2365 class AnalysisContentStatisticsImpl implements AnalysisContentStatistics { 2365 class AnalysisContentStatisticsImpl implements AnalysisContentStatistics {
2366 Map<String, AnalysisContentStatistics_CacheRow> _dataMap = new Map<String, Ana lysisContentStatistics_CacheRow>(); 2366 Map<String, AnalysisContentStatistics_CacheRow> _dataMap = new Map<String, Ana lysisContentStatistics_CacheRow>();
2367 List<AnalysisContentStatistics_CacheRow> get cacheRows { 2367 List<AnalysisContentStatistics_CacheRow> get cacheRows {
2368 Iterable<AnalysisContentStatistics_CacheRow> items = _dataMap.values; 2368 Iterable<AnalysisContentStatistics_CacheRow> items = _dataMap.values;
2369 return new List.from(items); 2369 return new List.from(items);
2370 } 2370 }
2371 void putCacheItem(DataDescriptor<Object> rowDesc, CacheState state) { 2371 void putCacheItem(DataDescriptor rowDesc, CacheState state) {
2372 String rowName = rowDesc.toString(); 2372 String rowName = rowDesc.toString();
2373 AnalysisContentStatisticsImpl_CacheRowImpl row = _dataMap[rowName] as Analys isContentStatisticsImpl_CacheRowImpl; 2373 AnalysisContentStatisticsImpl_CacheRowImpl row = _dataMap[rowName] as Analys isContentStatisticsImpl_CacheRowImpl;
2374 if (row == null) { 2374 if (row == null) {
2375 row = new AnalysisContentStatisticsImpl_CacheRowImpl(rowName); 2375 row = new AnalysisContentStatisticsImpl_CacheRowImpl(rowName);
2376 _dataMap[rowName] = row; 2376 _dataMap[rowName] = row;
2377 } 2377 }
2378 row.incState(state); 2378 row.incState(state);
2379 } 2379 }
2380 } 2380 }
2381 class AnalysisContentStatisticsImpl_CacheRowImpl implements AnalysisContentStati stics_CacheRow { 2381 class AnalysisContentStatisticsImpl_CacheRowImpl implements AnalysisContentStati stics_CacheRow {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2418 * Instances of the class `AnalysisContextImpl` implement an [AnalysisContext]. 2418 * Instances of the class `AnalysisContextImpl` implement an [AnalysisContext].
2419 * 2419 *
2420 * @coverage dart.engine 2420 * @coverage dart.engine
2421 */ 2421 */
2422 class AnalysisContextImpl implements InternalAnalysisContext { 2422 class AnalysisContextImpl implements InternalAnalysisContext {
2423 2423
2424 /** 2424 /**
2425 * Helper for [getStatistics], puts the library-specific state into the given statistics 2425 * Helper for [getStatistics], puts the library-specific state into the given statistics
2426 * object. 2426 * object.
2427 */ 2427 */
2428 static void putStatCacheItem(AnalysisContentStatisticsImpl statistics, DartEnt ry dartEntry, Source librarySource, DataDescriptor<Object> key) { 2428 static void putStatCacheItem(AnalysisContentStatisticsImpl statistics, DartEnt ry dartEntry, Source librarySource, DataDescriptor key) {
2429 statistics.putCacheItem(key, dartEntry.getState2(key, librarySource)); 2429 statistics.putCacheItem(key, dartEntry.getState2(key, librarySource));
2430 } 2430 }
2431 2431
2432 /** 2432 /**
2433 * Helper for [getStatistics], puts the library independent state into the giv en 2433 * Helper for [getStatistics], puts the library independent state into the giv en
2434 * statistics object. 2434 * statistics object.
2435 */ 2435 */
2436 static void putStatCacheItem2(AnalysisContentStatisticsImpl statistics, Source Entry entry, DataDescriptor<Object> key) { 2436 static void putStatCacheItem2(AnalysisContentStatisticsImpl statistics, Source Entry entry, DataDescriptor key) {
2437 statistics.putCacheItem(key, entry.getState(key)); 2437 statistics.putCacheItem(key, entry.getState(key));
2438 } 2438 }
2439 2439
2440 /** 2440 /**
2441 * The set of analysis options controlling the behavior of this context. 2441 * The set of analysis options controlling the behavior of this context.
2442 */ 2442 */
2443 AnalysisOptions _options = new AnalysisOptionsImpl(); 2443 AnalysisOptions _options = new AnalysisOptionsImpl();
2444 2444
2445 /** 2445 /**
2446 * The source factory used to create the sources that can be analyzed in this context. 2446 * The source factory used to create the sources that can be analyzed in this context.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2620 } 2620 }
2621 return htmlEntry.getValue(HtmlEntry.ELEMENT); 2621 return htmlEntry.getValue(HtmlEntry.ELEMENT);
2622 } 2622 }
2623 List<Source> computeImportedLibraries(Source source) => internalGetDartParseDa ta2(source, DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY); 2623 List<Source> computeImportedLibraries(Source source) => internalGetDartParseDa ta2(source, DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
2624 SourceKind computeKindOf(Source source) { 2624 SourceKind computeKindOf(Source source) {
2625 SourceEntry sourceEntry = getReadableSourceEntry(source); 2625 SourceEntry sourceEntry = getReadableSourceEntry(source);
2626 if (sourceEntry == null) { 2626 if (sourceEntry == null) {
2627 return SourceKind.UNKNOWN; 2627 return SourceKind.UNKNOWN;
2628 } else if (sourceEntry is DartEntry) { 2628 } else if (sourceEntry is DartEntry) {
2629 try { 2629 try {
2630 return internalGetDartParseData(source, (sourceEntry as DartEntry), Dart Entry.SOURCE_KIND); 2630 return internalGetDartParseData(source, sourceEntry as DartEntry, DartEn try.SOURCE_KIND);
2631 } on AnalysisException catch (exception) { 2631 } on AnalysisException catch (exception) {
2632 return SourceKind.UNKNOWN; 2632 return SourceKind.UNKNOWN;
2633 } 2633 }
2634 } 2634 }
2635 return sourceEntry.kind; 2635 return sourceEntry.kind;
2636 } 2636 }
2637 LibraryElement computeLibraryElement(Source source) { 2637 LibraryElement computeLibraryElement(Source source) {
2638 { 2638 {
2639 DartEntry dartEntry = getDartEntry(source); 2639 DartEntry dartEntry = getDartEntry(source);
2640 if (dartEntry == null) { 2640 if (dartEntry == null) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2679 DartEntryImpl dartCopy = dartEntry.writableCopy; 2679 DartEntryImpl dartCopy = dartEntry.writableCopy;
2680 CompilationUnit unit = dartCopy.resolvableCompilationUnit; 2680 CompilationUnit unit = dartCopy.resolvableCompilationUnit;
2681 if (unit != null) { 2681 if (unit != null) {
2682 _sourceMap[source] = dartCopy; 2682 _sourceMap[source] = dartCopy;
2683 return new ResolvableCompilationUnit(dartCopy.modificationTime, unit); 2683 return new ResolvableCompilationUnit(dartCopy.modificationTime, unit);
2684 } 2684 }
2685 } 2685 }
2686 internalParseDart(source); 2686 internalParseDart(source);
2687 } 2687 }
2688 } 2688 }
2689 AnalysisContext extractContext(SourceContainer container) => extractContextInt o(container, (AnalysisEngine.instance.createAnalysisContext() as InternalAnalysi sContext)); 2689 AnalysisContext extractContext(SourceContainer container) => extractContextInt o(container, AnalysisEngine.instance.createAnalysisContext() as InternalAnalysis Context);
2690 InternalAnalysisContext extractContextInto(SourceContainer container, Internal AnalysisContext newContext) { 2690 InternalAnalysisContext extractContextInto(SourceContainer container, Internal AnalysisContext newContext) {
2691 List<Source> sourcesToRemove = new List<Source>(); 2691 List<Source> sourcesToRemove = new List<Source>();
2692 { 2692 {
2693 for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) { 2693 for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
2694 Source source = entry.getKey(); 2694 Source source = entry.getKey();
2695 if (container.contains(source)) { 2695 if (container.contains(source)) {
2696 sourcesToRemove.add(source); 2696 sourcesToRemove.add(source);
2697 newContext.addSourceInfo(source, entry.getValue().writableCopy); 2697 newContext.addSourceInfo(source, entry.getValue().writableCopy);
2698 } 2698 }
2699 } 2699 }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3073 TypeProvider typeProvider = new TypeProviderImpl(coreElement); 3073 TypeProvider typeProvider = new TypeProviderImpl(coreElement);
3074 ResolvableCompilationUnit resolvableUnit = computeResolvableCompilat ionUnit(unitSource); 3074 ResolvableCompilationUnit resolvableUnit = computeResolvableCompilat ionUnit(unitSource);
3075 CompilationUnit unitAST = resolvableUnit.compilationUnit; 3075 CompilationUnit unitAST = resolvableUnit.compilationUnit;
3076 new DeclarationResolver().resolve(unitAST, find(libraryElement, unit Source)); 3076 new DeclarationResolver().resolve(unitAST, find(libraryElement, unit Source));
3077 RecordingErrorListener errorListener = new RecordingErrorListener(); 3077 RecordingErrorListener errorListener = new RecordingErrorListener();
3078 TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor.co n2(libraryElement, unitSource, typeProvider, errorListener); 3078 TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor.co n2(libraryElement, unitSource, typeProvider, errorListener);
3079 unitAST.accept(typeResolverVisitor); 3079 unitAST.accept(typeResolverVisitor);
3080 InheritanceManager inheritanceManager = new InheritanceManager(libra ryElement); 3080 InheritanceManager inheritanceManager = new InheritanceManager(libra ryElement);
3081 ResolverVisitor resolverVisitor = new ResolverVisitor.con2(libraryEl ement, unitSource, typeProvider, inheritanceManager, errorListener); 3081 ResolverVisitor resolverVisitor = new ResolverVisitor.con2(libraryEl ement, unitSource, typeProvider, inheritanceManager, errorListener);
3082 unitAST.accept(resolverVisitor); 3082 unitAST.accept(resolverVisitor);
3083 for (ProxyConditionalAnalysisError conditionalCode in resolverVisito r.proxyConditionalAnalysisErrors) {
3084 if (conditionalCode.shouldIncludeErrorCode()) {
3085 resolverVisitor.reportError(conditionalCode.analysisError);
3086 }
3087 }
3083 ErrorReporter errorReporter = new ErrorReporter(errorListener, unitS ource); 3088 ErrorReporter errorReporter = new ErrorReporter(errorListener, unitS ource);
3084 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, libra ryElement, typeProvider, inheritanceManager); 3089 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, libra ryElement, typeProvider, inheritanceManager);
3085 unitAST.accept(errorVerifier); 3090 unitAST.accept(errorVerifier);
3086 ConstantVerifier constantVerifier = new ConstantVerifier(errorReport er, typeProvider); 3091 ConstantVerifier constantVerifier = new ConstantVerifier(errorReport er, typeProvider);
3087 unitAST.accept(constantVerifier); 3092 unitAST.accept(constantVerifier);
3088 unitAST.resolutionErrors = errorListener.errors; 3093 unitAST.resolutionErrors = errorListener.errors;
3089 DartEntryImpl dartCopy = getDartEntry(unitSource).writableCopy; 3094 DartEntryImpl dartCopy = getDartEntry(unitSource).writableCopy;
3090 dartCopy.setValue2(DartEntry.RESOLVED_UNIT, librarySource, unitAST); 3095 dartCopy.setValue2(DartEntry.RESOLVED_UNIT, librarySource, unitAST);
3091 _sourceMap[unitSource] = dartCopy; 3096 _sourceMap[unitSource] = dartCopy;
3092 unit = unitAST; 3097 unit = unitAST;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
3585 3590
3586 /** 3591 /**
3587 * Given a source for an HTML file, return a cache entry in which all of the d ata represented by 3592 * Given a source for an HTML file, return a cache entry in which all of the d ata represented by
3588 * the given descriptors is available. This method assumes that the data can b e produced by 3593 * the given descriptors is available. This method assumes that the data can b e produced by
3589 * parsing the source if it is not already cached. 3594 * parsing the source if it is not already cached.
3590 * 3595 *
3591 * @param htmlEntry the cache entry associated with the HTML file 3596 * @param htmlEntry the cache entry associated with the HTML file
3592 * @param descriptor the descriptor representing the data to be returned 3597 * @param descriptor the descriptor representing the data to be returned
3593 * @return a cache entry containing the required data 3598 * @return a cache entry containing the required data
3594 */ 3599 */
3595 bool hasHtmlParseDataCached(HtmlEntry htmlEntry, List<DataDescriptor<Object>> descriptors) { 3600 bool hasHtmlParseDataCached(HtmlEntry htmlEntry, List<DataDescriptor> descript ors) {
3596 for (DataDescriptor<Object> descriptor in descriptors) { 3601 for (DataDescriptor descriptor in descriptors) {
3597 CacheState state = htmlEntry.getState(descriptor); 3602 CacheState state = htmlEntry.getState(descriptor);
3598 if (state != CacheState.VALID && state != CacheState.ERROR) { 3603 if (state != CacheState.VALID && state != CacheState.ERROR) {
3599 return false; 3604 return false;
3600 } 3605 }
3601 } 3606 }
3602 return true; 3607 return true;
3603 } 3608 }
3604 3609
3605 /** 3610 /**
3606 * Given a source for a Dart file, return a cache entry in which the data repr esented by the given 3611 * Given a source for a Dart file, return a cache entry in which the data repr esented by the given
3607 * descriptor is available. This method assumes that the data can be produced by parsing the 3612 * descriptor is available. This method assumes that the data can be produced by parsing the
3608 * source if it is not already cached. 3613 * source if it is not already cached.
3609 * 3614 *
3610 * @param source the source representing the Dart file 3615 * @param source the source representing the Dart file
3611 * @param dartEntry the cache entry associated with the Dart file 3616 * @param dartEntry the cache entry associated with the Dart file
3612 * @param descriptor the descriptor representing the data to be returned 3617 * @param descriptor the descriptor representing the data to be returned
3613 * @return a cache entry containing the required data 3618 * @return a cache entry containing the required data
3614 * @throws AnalysisException if data could not be returned because the source could not be 3619 * @throws AnalysisException if data could not be returned because the source could not be
3615 * resolved 3620 * resolved
3616 */ 3621 */
3617 DartEntry internalCacheDartParseData(Source source, DartEntry dartEntry, DataD escriptor<Object> descriptor) { 3622 DartEntry internalCacheDartParseData(Source source, DartEntry dartEntry, DataD escriptor descriptor) {
3618 CacheState state = dartEntry.getState(descriptor); 3623 CacheState state = dartEntry.getState(descriptor);
3619 while (state != CacheState.ERROR && state != CacheState.VALID) { 3624 while (state != CacheState.ERROR && state != CacheState.VALID) {
3620 dartEntry = internalParseDart(source); 3625 dartEntry = internalParseDart(source);
3621 state = dartEntry.getState(descriptor); 3626 state = dartEntry.getState(descriptor);
3622 } 3627 }
3623 return dartEntry; 3628 return dartEntry;
3624 } 3629 }
3625 3630
3626 /** 3631 /**
3627 * Given a source for a Dart file and the library that contains it, return a c ache entry in which 3632 * Given a source for a Dart file and the library that contains it, return a c ache entry in which
3628 * all of the data represented by the given descriptors is available. This met hod assumes that the 3633 * all of the data represented by the given descriptors is available. This met hod assumes that the
3629 * data can be produced by resolving the source in the context of the library if it is not already 3634 * data can be produced by resolving the source in the context of the library if it is not already
3630 * cached. 3635 * cached.
3631 * 3636 *
3632 * @param unitSource the source representing the Dart file 3637 * @param unitSource the source representing the Dart file
3633 * @param librarySource the source representing the library containing the Dar t file 3638 * @param librarySource the source representing the library containing the Dar t file
3634 * @param dartEntry the cache entry associated with the Dart file 3639 * @param dartEntry the cache entry associated with the Dart file
3635 * @param descriptor the descriptor representing the data to be returned 3640 * @param descriptor the descriptor representing the data to be returned
3636 * @return the requested data about the given source 3641 * @return the requested data about the given source
3637 * @throws AnalysisException if data could not be returned because the source could not be parsed 3642 * @throws AnalysisException if data could not be returned because the source could not be parsed
3638 */ 3643 */
3639 DartEntry internalCacheDartResolutionData(Source unitSource, Source librarySou rce, DartEntry dartEntry, DataDescriptor<Object> descriptor) { 3644 DartEntry internalCacheDartResolutionData(Source unitSource, Source librarySou rce, DartEntry dartEntry, DataDescriptor descriptor) {
3640 CacheState state = dartEntry.getState2(descriptor, librarySource); 3645 CacheState state = dartEntry.getState2(descriptor, librarySource);
3641 while (state != CacheState.ERROR && state != CacheState.VALID) { 3646 while (state != CacheState.ERROR && state != CacheState.VALID) {
3642 dartEntry = internalResolveDart(unitSource, librarySource); 3647 dartEntry = internalResolveDart(unitSource, librarySource);
3643 state = dartEntry.getState2(descriptor, librarySource); 3648 state = dartEntry.getState2(descriptor, librarySource);
3644 } 3649 }
3645 return dartEntry; 3650 return dartEntry;
3646 } 3651 }
3647 3652
3648 /** 3653 /**
3649 * Given a source for an HTML file, return a cache entry in which all of the d ata represented by 3654 * Given a source for an HTML file, return a cache entry in which all of the d ata represented by
3650 * the given descriptors is available. This method assumes that the data can b e produced by 3655 * the given descriptors is available. This method assumes that the data can b e produced by
3651 * parsing the source if it is not already cached. 3656 * parsing the source if it is not already cached.
3652 * 3657 *
3653 * @param source the source representing the HTML file 3658 * @param source the source representing the HTML file
3654 * @param htmlEntry the cache entry associated with the HTML file 3659 * @param htmlEntry the cache entry associated with the HTML file
3655 * @param descriptor the descriptor representing the data to be returned 3660 * @param descriptor the descriptor representing the data to be returned
3656 * @return a cache entry containing the required data 3661 * @return a cache entry containing the required data
3657 * @throws AnalysisException if data could not be returned because the source could not be 3662 * @throws AnalysisException if data could not be returned because the source could not be
3658 * resolved 3663 * resolved
3659 */ 3664 */
3660 HtmlEntry internalCacheHtmlParseData(Source source, HtmlEntry htmlEntry, List< DataDescriptor<Object>> descriptors) { 3665 HtmlEntry internalCacheHtmlParseData(Source source, HtmlEntry htmlEntry, List< DataDescriptor> descriptors) {
3661 while (!hasHtmlParseDataCached(htmlEntry, descriptors)) { 3666 while (!hasHtmlParseDataCached(htmlEntry, descriptors)) {
3662 htmlEntry = internalParseHtml(source); 3667 htmlEntry = internalParseHtml(source);
3663 } 3668 }
3664 return htmlEntry; 3669 return htmlEntry;
3665 } 3670 }
3666 3671
3667 /** 3672 /**
3668 * Given a source for a Dart file, return the data represented by the given de scriptor that is 3673 * Given a source for a Dart file, return the data represented by the given de scriptor that is
3669 * associated with that source. This method assumes that the data can be produ ced by parsing the 3674 * associated with that source. This method assumes that the data can be produ ced by parsing the
3670 * source if it is not already cached. 3675 * source if it is not already cached.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3790 CompilationUnit unit = parser.parseCompilationUnit(scanResult._token); 3795 CompilationUnit unit = parser.parseCompilationUnit(scanResult._token);
3791 LineInfo lineInfo = new LineInfo(scanResult._lineStarts); 3796 LineInfo lineInfo = new LineInfo(scanResult._lineStarts);
3792 List<AnalysisError> errors = errorListener.getErrors2(source); 3797 List<AnalysisError> errors = errorListener.getErrors2(source);
3793 bool hasPartOfDirective = false; 3798 bool hasPartOfDirective = false;
3794 bool hasLibraryDirective = false; 3799 bool hasLibraryDirective = false;
3795 Set<Source> exportedSources = new Set<Source>(); 3800 Set<Source> exportedSources = new Set<Source>();
3796 Set<Source> importedSources = new Set<Source>(); 3801 Set<Source> importedSources = new Set<Source>();
3797 Set<Source> includedSources = new Set<Source>(); 3802 Set<Source> includedSources = new Set<Source>();
3798 for (Directive directive in unit.directives) { 3803 for (Directive directive in unit.directives) {
3799 if (directive is ExportDirective) { 3804 if (directive is ExportDirective) {
3800 Source exportSource = resolveSource(source, (directive as ExportDirect ive)); 3805 Source exportSource = resolveSource(source, directive as ExportDirecti ve);
3801 if (exportSource != null) { 3806 if (exportSource != null) {
3802 javaSetAdd(exportedSources, exportSource); 3807 javaSetAdd(exportedSources, exportSource);
3803 } 3808 }
3804 } else if (directive is ImportDirective) { 3809 } else if (directive is ImportDirective) {
3805 Source importSource = resolveSource(source, (directive as ImportDirect ive)); 3810 Source importSource = resolveSource(source, directive as ImportDirecti ve);
3806 if (importSource != null) { 3811 if (importSource != null) {
3807 javaSetAdd(importedSources, importSource); 3812 javaSetAdd(importedSources, importSource);
3808 } 3813 }
3809 } else if (directive is LibraryDirective) { 3814 } else if (directive is LibraryDirective) {
3810 hasLibraryDirective = true; 3815 hasLibraryDirective = true;
3811 } else if (directive is PartDirective) { 3816 } else if (directive is PartDirective) {
3812 Source partSource = resolveSource(source, (directive as PartDirective) ); 3817 Source partSource = resolveSource(source, directive as PartDirective);
3813 if (partSource != null) { 3818 if (partSource != null) {
3814 javaSetAdd(includedSources, partSource); 3819 javaSetAdd(includedSources, partSource);
3815 } 3820 }
3816 } else if (directive is PartOfDirective) { 3821 } else if (directive is PartOfDirective) {
3817 hasPartOfDirective = true; 3822 hasPartOfDirective = true;
3818 } 3823 }
3819 } 3824 }
3820 unit.parsingErrors = errors; 3825 unit.parsingErrors = errors;
3821 unit.lineInfo = lineInfo; 3826 unit.lineInfo = lineInfo;
3822 if (identical(dartCopy.getState(DartEntry.SOURCE_KIND), CacheState.INVALID )) { 3827 if (identical(dartCopy.getState(DartEntry.SOURCE_KIND), CacheState.INVALID )) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 AnalysisException thrownException = null; 3871 AnalysisException thrownException = null;
3867 try { 3872 try {
3868 RecordingErrorListener errorListener = new RecordingErrorListener(); 3873 RecordingErrorListener errorListener = new RecordingErrorListener();
3869 scanResult = internalScan(source, errorListener); 3874 scanResult = internalScan(source, errorListener);
3870 Parser parser = new Parser(source, errorListener); 3875 Parser parser = new Parser(source, errorListener);
3871 unit = parser.parseCompilationUnit(scanResult._token); 3876 unit = parser.parseCompilationUnit(scanResult._token);
3872 lineInfo = new LineInfo(scanResult._lineStarts); 3877 lineInfo = new LineInfo(scanResult._lineStarts);
3873 errors = errorListener.getErrors2(source); 3878 errors = errorListener.getErrors2(source);
3874 for (Directive directive in unit.directives) { 3879 for (Directive directive in unit.directives) {
3875 if (directive is ExportDirective) { 3880 if (directive is ExportDirective) {
3876 Source exportSource = resolveSource(source, (directive as ExportDirect ive)); 3881 Source exportSource = resolveSource(source, directive as ExportDirecti ve);
3877 if (exportSource != null) { 3882 if (exportSource != null) {
3878 javaSetAdd(exportedSources, exportSource); 3883 javaSetAdd(exportedSources, exportSource);
3879 } 3884 }
3880 } else if (directive is ImportDirective) { 3885 } else if (directive is ImportDirective) {
3881 Source importSource = resolveSource(source, (directive as ImportDirect ive)); 3886 Source importSource = resolveSource(source, directive as ImportDirecti ve);
3882 if (importSource != null) { 3887 if (importSource != null) {
3883 javaSetAdd(importedSources, importSource); 3888 javaSetAdd(importedSources, importSource);
3884 } 3889 }
3885 } else if (directive is LibraryDirective) { 3890 } else if (directive is LibraryDirective) {
3886 hasLibraryDirective = true; 3891 hasLibraryDirective = true;
3887 } else if (directive is PartDirective) { 3892 } else if (directive is PartDirective) {
3888 Source partSource = resolveSource(source, (directive as PartDirective) ); 3893 Source partSource = resolveSource(source, directive as PartDirective);
3889 if (partSource != null) { 3894 if (partSource != null) {
3890 javaSetAdd(includedSources, partSource); 3895 javaSetAdd(includedSources, partSource);
3891 } 3896 }
3892 } else if (directive is PartOfDirective) { 3897 } else if (directive is PartOfDirective) {
3893 hasPartOfDirective = true; 3898 hasPartOfDirective = true;
3894 } 3899 }
3895 } 3900 }
3896 unit.parsingErrors = errors; 3901 unit.parsingErrors = errors;
3897 unit.lineInfo = lineInfo; 3902 unit.lineInfo = lineInfo;
3898 } on AnalysisException catch (exception) { 3903 } on AnalysisException catch (exception) {
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
4420 * Parse the given source and update the cache. 4425 * Parse the given source and update the cache.
4421 * 4426 *
4422 * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock]. 4427 * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
4423 * 4428 *
4424 * @param source the source to be parsed 4429 * @param source the source to be parsed
4425 */ 4430 */
4426 void safelyParseHtmlUnit(Source source) { 4431 void safelyParseHtmlUnit(Source source) {
4427 try { 4432 try {
4428 parseHtmlUnit(source); 4433 parseHtmlUnit(source);
4429 } on AnalysisException catch (exception) { 4434 } on AnalysisException catch (exception) {
4430 AnalysisEngine.instance.logger.logError2("Could not parse ${source.fullNam e}", exception); 4435 if (exception.cause is! JavaIOException) {
4436 AnalysisEngine.instance.logger.logError2("Could not parse ${source.fullN ame}", exception);
4437 }
4431 } 4438 }
4432 } 4439 }
4433 4440
4434 /** 4441 /**
4435 * Resolve the given source and update the cache. 4442 * Resolve the given source and update the cache.
4436 * 4443 *
4437 * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock]. 4444 * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
4438 * 4445 *
4439 * @param source the source to be resolved 4446 * @param source the source to be resolved
4440 */ 4447 */
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
4903 * 4910 *
4904 * @param isStrict `true` if analysis is to use strict mode 4911 * @param isStrict `true` if analysis is to use strict mode
4905 */ 4912 */
4906 void set strictMode(bool isStrict) { 4913 void set strictMode(bool isStrict) {
4907 _strictMode = isStrict; 4914 _strictMode = isStrict;
4908 } 4915 }
4909 } 4916 }
4910 /** 4917 /**
4911 * The enumeration `CacheState` defines the possible states of cached data. 4918 * The enumeration `CacheState` defines the possible states of cached data.
4912 */ 4919 */
4913 class CacheState implements Enum<CacheState> { 4920 class CacheState extends Enum<CacheState> {
4914 4921
4915 /** 4922 /**
4916 * The data is not in the cache and the last time an attempt was made to compu te the data an 4923 * The data is not in the cache and the last time an attempt was made to compu te the data an
4917 * exception occurred, making it pointless to attempt. 4924 * exception occurred, making it pointless to attempt.
4918 * 4925 *
4919 * Valid Transitions: 4926 * Valid Transitions:
4920 * 4927 *
4921 * * [INVALID] if a source was modified that might cause the data to be comput able 4928 * * [INVALID] if a source was modified that might cause the data to be comput able
4922 * 4929 *
4923 */ 4930 */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4960 * The data is in the cache and up-to-date. 4967 * The data is in the cache and up-to-date.
4961 * 4968 *
4962 * Valid Transitions: 4969 * Valid Transitions:
4963 * 4970 *
4964 * * [FLUSHED] if the data is removed in order to manage memory usage 4971 * * [FLUSHED] if the data is removed in order to manage memory usage
4965 * * [INVALID] if a source was modified in such a way as to invalidate the pre vious data 4972 * * [INVALID] if a source was modified in such a way as to invalidate the pre vious data
4966 * 4973 *
4967 */ 4974 */
4968 static final CacheState VALID = new CacheState('VALID', 4); 4975 static final CacheState VALID = new CacheState('VALID', 4);
4969 static final List<CacheState> values = [ERROR, FLUSHED, IN_PROCESS, INVALID, V ALID]; 4976 static final List<CacheState> values = [ERROR, FLUSHED, IN_PROCESS, INVALID, V ALID];
4970 4977 CacheState(String name, int ordinal) : super(name, ordinal);
4971 /// The name of this enum constant, as declared in the enum declaration.
4972 final String name;
4973
4974 /// The position in the enum declaration.
4975 final int ordinal;
4976 CacheState(this.name, this.ordinal);
4977 int compareTo(CacheState other) => ordinal - other.ordinal;
4978 int get hashCode => ordinal;
4979 String toString() => name;
4980 } 4978 }
4981 /** 4979 /**
4982 * Instances of the class `ChangeNoticeImpl` represent a change to the analysis results 4980 * Instances of the class `ChangeNoticeImpl` represent a change to the analysis results
4983 * associated with a given source. 4981 * associated with a given source.
4984 * 4982 *
4985 * @coverage dart.engine 4983 * @coverage dart.engine
4986 */ 4984 */
4987 class ChangeNoticeImpl implements ChangeNotice { 4985 class ChangeNoticeImpl implements ChangeNotice {
4988 4986
4989 /** 4987 /**
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6158 } 6156 }
6159 void logError2(String message, Exception exception) { 6157 void logError2(String message, Exception exception) {
6160 } 6158 }
6161 void logError3(Exception exception) { 6159 void logError3(Exception exception) {
6162 } 6160 }
6163 void logInformation(String message) { 6161 void logInformation(String message) {
6164 } 6162 }
6165 void logInformation2(String message, Exception exception) { 6163 void logInformation2(String message, Exception exception) {
6166 } 6164 }
6167 } 6165 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/element.dart ('k') | pkg/analyzer_experimental/lib/src/generated/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698