| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 * Create a new context in which analysis can be performed. Any sources in the
specified container | 262 * Create a new context in which analysis can be performed. Any sources in the
specified container |
| 263 * will be removed from this context and added to the newly created context. | 263 * will be removed from this context and added to the newly created context. |
| 264 * | 264 * |
| 265 * @param container the container containing sources that should be removed fr
om this context and | 265 * @param container the container containing sources that should be removed fr
om this context and |
| 266 * added to the returned context | 266 * added to the returned context |
| 267 * @return the analysis context that was created | 267 * @return the analysis context that was created |
| 268 */ | 268 */ |
| 269 AnalysisContext extractContext(SourceContainer container); | 269 AnalysisContext extractContext(SourceContainer container); |
| 270 | 270 |
| 271 /** | 271 /** |
| 272 * Return the set of analysis options controlling the behavior of this context
. Changes to the | 272 * Return the set of analysis options controlling the behavior of this context
. Clients should not |
| 273 * return options will not affect this context. The options can only be set by
invoking the method | 273 * modify the returned set of options. The options should only be set by invok
ing the method |
| 274 * [setAnalysisOptions]. | 274 * [setAnalysisOptions]. |
| 275 * | 275 * |
| 276 * @return the set of analysis options controlling the behavior of this contex
t | 276 * @return the set of analysis options controlling the behavior of this contex
t |
| 277 */ | 277 */ |
| 278 AnalysisOptions get analysisOptions; | 278 AnalysisOptions get analysisOptions; |
| 279 | 279 |
| 280 /** | 280 /** |
| 281 * Return the element referenced by the given location, or `null` if the eleme
nt is not | 281 * Return the element referenced by the given location, or `null` if the eleme
nt is not |
| 282 * immediately available or if there is no element with the given location. Th
e latter condition | 282 * immediately available or if there is no element with the given location. Th
e latter condition |
| 283 * can occur, for example, if the location describes an element from a differe
nt context or if the | 283 * can occur, for example, if the location describes an element from a differe
nt context or if the |
| (...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2973 } | 2973 } |
| 2974 builder.append(tokens[i].lexeme); | 2974 builder.append(tokens[i].lexeme); |
| 2975 } | 2975 } |
| 2976 return builder.toString(); | 2976 return builder.toString(); |
| 2977 } | 2977 } |
| 2978 nameNode = nameNode.parent; | 2978 nameNode = nameNode.parent; |
| 2979 } | 2979 } |
| 2980 return null; | 2980 return null; |
| 2981 } | 2981 } |
| 2982 List<AnalysisError> computeErrors(Source source) { | 2982 List<AnalysisError> computeErrors(Source source) { |
| 2983 bool enableHints = analysisOptions.hint; | 2983 bool enableHints = _options.hint; |
| 2984 SourceEntry sourceEntry = getReadableSourceEntry(source); | 2984 SourceEntry sourceEntry = getReadableSourceEntry(source); |
| 2985 if (sourceEntry is DartEntry) { | 2985 if (sourceEntry is DartEntry) { |
| 2986 List<AnalysisError> errors = new List<AnalysisError>(); | 2986 List<AnalysisError> errors = new List<AnalysisError>(); |
| 2987 DartEntry dartEntry = sourceEntry as DartEntry; | 2987 DartEntry dartEntry = sourceEntry as DartEntry; |
| 2988 ListUtilities.addAll(errors, getDartParseData(source, dartEntry, DartEntry
.PARSE_ERRORS)); | 2988 ListUtilities.addAll(errors, getDartParseData(source, dartEntry, DartEntry
.PARSE_ERRORS)); |
| 2989 dartEntry = getReadableDartEntry(source); | 2989 dartEntry = getReadableDartEntry(source); |
| 2990 if (identical(dartEntry.getValue(DartEntry.SOURCE_KIND), SourceKind.LIBRAR
Y)) { | 2990 if (identical(dartEntry.getValue(DartEntry.SOURCE_KIND), SourceKind.LIBRAR
Y)) { |
| 2991 ListUtilities.addAll(errors, getDartResolutionData(source, source, dartE
ntry, DartEntry.RESOLUTION_ERRORS)); | 2991 ListUtilities.addAll(errors, getDartResolutionData(source, source, dartE
ntry, DartEntry.RESOLUTION_ERRORS)); |
| 2992 ListUtilities.addAll(errors, getDartVerificationData(source, source, dar
tEntry, DartEntry.VERIFICATION_ERRORS)); | 2992 ListUtilities.addAll(errors, getDartVerificationData(source, source, dar
tEntry, DartEntry.VERIFICATION_ERRORS)); |
| 2993 if (enableHints) { | 2993 if (enableHints) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3083 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 3083 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 3084 Source source = entry.getKey(); | 3084 Source source = entry.getKey(); |
| 3085 if (container.contains(source)) { | 3085 if (container.contains(source)) { |
| 3086 sourcesToRemove.add(source); | 3086 sourcesToRemove.add(source); |
| 3087 newContext.addSourceInfo(source, entry.getValue().writableCopy); | 3087 newContext.addSourceInfo(source, entry.getValue().writableCopy); |
| 3088 } | 3088 } |
| 3089 } | 3089 } |
| 3090 } | 3090 } |
| 3091 return newContext; | 3091 return newContext; |
| 3092 } | 3092 } |
| 3093 AnalysisOptions get analysisOptions => new AnalysisOptionsImpl.con1(_options); | 3093 AnalysisOptions get analysisOptions => _options; |
| 3094 Element getElement(ElementLocation location) { | 3094 Element getElement(ElementLocation location) { |
| 3095 try { | 3095 try { |
| 3096 List<String> components = ((location as ElementLocationImpl)).components; | 3096 List<String> components = ((location as ElementLocationImpl)).components; |
| 3097 Source librarySource = computeSourceFromEncoding(components[0]); | 3097 Source librarySource = computeSourceFromEncoding(components[0]); |
| 3098 ElementImpl element = computeLibraryElement(librarySource) as ElementImpl; | 3098 ElementImpl element = computeLibraryElement(librarySource) as ElementImpl; |
| 3099 for (int i = 1; i < components.length; i++) { | 3099 for (int i = 1; i < components.length; i++) { |
| 3100 if (element == null) { | 3100 if (element == null) { |
| 3101 return null; | 3101 return null; |
| 3102 } | 3102 } |
| 3103 element = element.getChild(components[i]); | 3103 element = element.getChild(components[i]); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3331 /** | 3331 /** |
| 3332 * Return a list of the sources that would be processed by [performAnalysisTas
k]. This | 3332 * Return a list of the sources that would be processed by [performAnalysisTas
k]. This |
| 3333 * method duplicates, and must therefore be kept in sync with, [getNextTaskAna
lysisTask]. | 3333 * method duplicates, and must therefore be kept in sync with, [getNextTaskAna
lysisTask]. |
| 3334 * This method is intended to be used for testing purposes only. | 3334 * This method is intended to be used for testing purposes only. |
| 3335 * | 3335 * |
| 3336 * @return a list of the sources that would be processed by [performAnalysisTa
sk] | 3336 * @return a list of the sources that would be processed by [performAnalysisTa
sk] |
| 3337 */ | 3337 */ |
| 3338 List<Source> get sourcesNeedingProcessing { | 3338 List<Source> get sourcesNeedingProcessing { |
| 3339 Set<Source> sources = new Set<Source>(); | 3339 Set<Source> sources = new Set<Source>(); |
| 3340 { | 3340 { |
| 3341 bool hintsEnabled = analysisOptions.hint; | 3341 bool hintsEnabled = _options.hint; |
| 3342 for (Source source in _priorityOrder) { | 3342 for (Source source in _priorityOrder) { |
| 3343 getSourcesNeedingProcessing2(source, _cache.get(source), true, hintsEnab
led, sources); | 3343 getSourcesNeedingProcessing2(source, _cache.get(source), true, hintsEnab
led, sources); |
| 3344 } | 3344 } |
| 3345 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 3345 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 3346 getSourcesNeedingProcessing2(entry.getKey(), entry.getValue(), false, hi
ntsEnabled, sources); | 3346 getSourcesNeedingProcessing2(entry.getKey(), entry.getValue(), false, hi
ntsEnabled, sources); |
| 3347 } | 3347 } |
| 3348 } | 3348 } |
| 3349 return new List<Source>.from(sources); | 3349 return new List<Source>.from(sources); |
| 3350 } | 3350 } |
| 3351 AnalysisContentStatistics get statistics { | 3351 AnalysisContentStatistics get statistics { |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3991 } | 3991 } |
| 3992 | 3992 |
| 3993 /** | 3993 /** |
| 3994 * Look through the cache for a task that needs to be performed. Return the ta
sk that was found, | 3994 * Look through the cache for a task that needs to be performed. Return the ta
sk that was found, |
| 3995 * or `null` if there is no more work to be done. | 3995 * or `null` if there is no more work to be done. |
| 3996 * | 3996 * |
| 3997 * @return the next task that needs to be performed | 3997 * @return the next task that needs to be performed |
| 3998 */ | 3998 */ |
| 3999 AnalysisTask get nextTaskAnalysisTask { | 3999 AnalysisTask get nextTaskAnalysisTask { |
| 4000 { | 4000 { |
| 4001 bool hintsEnabled = analysisOptions.hint; | 4001 bool hintsEnabled = _options.hint; |
| 4002 for (Source source in _priorityOrder) { | 4002 for (Source source in _priorityOrder) { |
| 4003 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); | 4003 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); |
| 4004 if (task != null) { | 4004 if (task != null) { |
| 4005 return task; | 4005 return task; |
| 4006 } | 4006 } |
| 4007 } | 4007 } |
| 4008 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 4008 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 4009 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); | 4009 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); |
| 4010 if (task != null) { | 4010 if (task != null) { |
| 4011 return task; | 4011 return task; |
| (...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6775 modificationTime = source.modificationStamp; | 6775 modificationTime = source.modificationStamp; |
| 6776 throw new AnalysisException.con3(exception); | 6776 throw new AnalysisException.con3(exception); |
| 6777 } | 6777 } |
| 6778 } finally { | 6778 } finally { |
| 6779 timeCounterScan.stop(); | 6779 timeCounterScan.stop(); |
| 6780 } | 6780 } |
| 6781 TimeCounter_TimeCounterHandle timeCounterParse = PerformanceStatistics.parse
.start(); | 6781 TimeCounter_TimeCounterHandle timeCounterParse = PerformanceStatistics.parse
.start(); |
| 6782 try { | 6782 try { |
| 6783 Parser parser = new Parser(source, errorListener); | 6783 Parser parser = new Parser(source, errorListener); |
| 6784 compilationUnit = parser.parseCompilationUnit(token[0]); | 6784 compilationUnit = parser.parseCompilationUnit(token[0]); |
| 6785 compilationUnit.lineInfo = lineInfo; | |
| 6786 errors = errorListener.getErrors2(source); | 6785 errors = errorListener.getErrors2(source); |
| 6787 for (Directive directive in compilationUnit.directives) { | 6786 for (Directive directive in compilationUnit.directives) { |
| 6788 if (directive is ExportDirective) { | 6787 if (directive is ExportDirective) { |
| 6789 Source exportSource = resolveSource(source, directive as ExportDirecti
ve); | 6788 Source exportSource = resolveSource(source, directive as ExportDirecti
ve); |
| 6790 if (exportSource != null) { | 6789 if (exportSource != null) { |
| 6791 javaSetAdd(_exportedSources, exportSource); | 6790 javaSetAdd(_exportedSources, exportSource); |
| 6792 } | 6791 } |
| 6793 } else if (directive is ImportDirective) { | 6792 } else if (directive is ImportDirective) { |
| 6794 Source importSource = resolveSource(source, directive as ImportDirecti
ve); | 6793 Source importSource = resolveSource(source, directive as ImportDirecti
ve); |
| 6795 if (importSource != null) { | 6794 if (importSource != null) { |
| 6796 javaSetAdd(_importedSources, importSource); | 6795 javaSetAdd(_importedSources, importSource); |
| 6797 } | 6796 } |
| 6798 } else if (directive is LibraryDirective) { | 6797 } else if (directive is LibraryDirective) { |
| 6799 _hasLibraryDirective2 = true; | 6798 _hasLibraryDirective2 = true; |
| 6800 } else if (directive is PartDirective) { | 6799 } else if (directive is PartDirective) { |
| 6801 Source partSource = resolveSource(source, directive as PartDirective); | 6800 Source partSource = resolveSource(source, directive as PartDirective); |
| 6802 if (partSource != null) { | 6801 if (partSource != null) { |
| 6803 javaSetAdd(_includedSources, partSource); | 6802 javaSetAdd(_includedSources, partSource); |
| 6804 } | 6803 } |
| 6805 } else if (directive is PartOfDirective) { | 6804 } else if (directive is PartOfDirective) { |
| 6806 _hasPartOfDirective2 = true; | 6805 _hasPartOfDirective2 = true; |
| 6807 } | 6806 } |
| 6808 } | 6807 } |
| 6808 compilationUnit.lineInfo = lineInfo; |
| 6809 } finally { | 6809 } finally { |
| 6810 timeCounterParse.stop(); | 6810 timeCounterParse.stop(); |
| 6811 } | 6811 } |
| 6812 } | 6812 } |
| 6813 | 6813 |
| 6814 /** | 6814 /** |
| 6815 * Return the result of resolving the URI of the given URI-based directive aga
inst the URI of the | 6815 * Return the result of resolving the URI of the given URI-based directive aga
inst the URI of the |
| 6816 * given library, or `null` if the URI is not valid. | 6816 * given library, or `null` if the URI is not valid. |
| 6817 * | 6817 * |
| 6818 * @param librarySource the source representing the library containing the dir
ective | 6818 * @param librarySource the source representing the library containing the dir
ective |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7259 } | 7259 } |
| 7260 void logError2(String message, Exception exception) { | 7260 void logError2(String message, Exception exception) { |
| 7261 } | 7261 } |
| 7262 void logError3(Exception exception) { | 7262 void logError3(Exception exception) { |
| 7263 } | 7263 } |
| 7264 void logInformation(String message) { | 7264 void logInformation(String message) { |
| 7265 } | 7265 } |
| 7266 void logInformation2(String message, Exception exception) { | 7266 void logInformation2(String message, Exception exception) { |
| 7267 } | 7267 } |
| 7268 } | 7268 } |
| OLD | NEW |