| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine; | 8 library engine; |
| 9 | 9 |
| 10 import "dart:math" as math; | 10 import "dart:math" as math; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 import 'incremental_scanner.dart'; | 28 import 'incremental_scanner.dart'; |
| 29 import 'java_core.dart'; | 29 import 'java_core.dart'; |
| 30 import 'java_engine.dart'; | 30 import 'java_engine.dart'; |
| 31 import 'parser.dart' show Parser, IncrementalParser; | 31 import 'parser.dart' show Parser, IncrementalParser; |
| 32 import 'resolver.dart'; | 32 import 'resolver.dart'; |
| 33 import 'scanner.dart'; | 33 import 'scanner.dart'; |
| 34 import 'sdk.dart' show DartSdk; | 34 import 'sdk.dart' show DartSdk; |
| 35 import 'source.dart'; | 35 import 'source.dart'; |
| 36 import 'utilities_collection.dart'; | 36 import 'utilities_collection.dart'; |
| 37 import 'utilities_general.dart'; | 37 import 'utilities_general.dart'; |
| 38 import 'package:analyzer/src/plugin/engine_plugin.dart'; |
| 38 | 39 |
| 39 /** | 40 /** |
| 40 * Used by [AnalysisOptions] to allow function bodies to be analyzed in some | 41 * Used by [AnalysisOptions] to allow function bodies to be analyzed in some |
| 41 * sources but not others. | 42 * sources but not others. |
| 42 */ | 43 */ |
| 43 typedef bool AnalyzeFunctionBodiesPredicate(Source source); | 44 typedef bool AnalyzeFunctionBodiesPredicate(Source source); |
| 44 | 45 |
| 45 /** | 46 /** |
| 46 * Type of callback functions used by PendingFuture. Functions of this type | 47 * Type of callback functions used by PendingFuture. Functions of this type |
| 47 * should perform a computation based on the data in [sourceEntry] and return | 48 * should perform a computation based on the data in [sourceEntry] and return |
| (...skipping 6022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6070 buffer.write(", "); | 6071 buffer.write(", "); |
| 6071 } | 6072 } |
| 6072 buffer.write(source.fullName); | 6073 buffer.write(source.fullName); |
| 6073 } | 6074 } |
| 6074 }); | 6075 }); |
| 6075 return needsSeparator || !first; | 6076 return needsSeparator || !first; |
| 6076 } | 6077 } |
| 6077 } | 6078 } |
| 6078 | 6079 |
| 6079 /** | 6080 /** |
| 6080 * The unique instance of the class `AnalysisEngine` serves as the entry point | 6081 * The entry point for the functionality provided by the analysis engine. There |
| 6081 * for the functionality provided by the analysis engine. | 6082 * is a single instance of this class. |
| 6082 */ | 6083 */ |
| 6083 class AnalysisEngine { | 6084 class AnalysisEngine { |
| 6084 /** | 6085 /** |
| 6085 * The suffix used for Dart source files. | 6086 * The suffix used for Dart source files. |
| 6086 */ | 6087 */ |
| 6087 static String SUFFIX_DART = "dart"; | 6088 static const String SUFFIX_DART = "dart"; |
| 6088 | 6089 |
| 6089 /** | 6090 /** |
| 6090 * The short suffix used for HTML files. | 6091 * The short suffix used for HTML files. |
| 6091 */ | 6092 */ |
| 6092 static String SUFFIX_HTM = "htm"; | 6093 static const String SUFFIX_HTM = "htm"; |
| 6093 | 6094 |
| 6094 /** | 6095 /** |
| 6095 * The long suffix used for HTML files. | 6096 * The long suffix used for HTML files. |
| 6096 */ | 6097 */ |
| 6097 static String SUFFIX_HTML = "html"; | 6098 static const String SUFFIX_HTML = "html"; |
| 6098 | 6099 |
| 6099 /** | 6100 /** |
| 6100 * The unique instance of this class. | 6101 * The unique instance of this class. |
| 6101 */ | 6102 */ |
| 6102 static AnalysisEngine _UniqueInstance = new AnalysisEngine(); | 6103 static final AnalysisEngine instance = new AnalysisEngine._(); |
| 6103 | 6104 |
| 6104 /** | 6105 /** |
| 6105 * Return the unique instance of this class. | 6106 * The logger that should receive information about errors within the analysis |
| 6106 * | 6107 * engine. |
| 6107 * @return the unique instance of this class | |
| 6108 */ | |
| 6109 static AnalysisEngine get instance => _UniqueInstance; | |
| 6110 | |
| 6111 /** | |
| 6112 * The logger that should receive information about errors within the analysis
engine. | |
| 6113 */ | 6108 */ |
| 6114 Logger _logger = Logger.NULL; | 6109 Logger _logger = Logger.NULL; |
| 6115 | 6110 |
| 6116 /** | 6111 /** |
| 6112 * The plugin that defines the extension points and extensions that are |
| 6113 * inherently defined by the analysis engine. |
| 6114 */ |
| 6115 final EnginePlugin enginePlugin = new EnginePlugin(); |
| 6116 |
| 6117 /** |
| 6117 * The instrumentation service that is to be used by this analysis engine. | 6118 * The instrumentation service that is to be used by this analysis engine. |
| 6118 */ | 6119 */ |
| 6119 InstrumentationService _instrumentationService = | 6120 InstrumentationService _instrumentationService = |
| 6120 InstrumentationService.NULL_SERVICE; | 6121 InstrumentationService.NULL_SERVICE; |
| 6121 | 6122 |
| 6122 /** | 6123 /** |
| 6123 * The partition manager being used to manage the shared partitions. | 6124 * The partition manager being used to manage the shared partitions. |
| 6124 */ | 6125 */ |
| 6125 final PartitionManager partitionManager = new PartitionManager(); | 6126 final PartitionManager partitionManager = new PartitionManager(); |
| 6126 | 6127 |
| 6127 /** | 6128 /** |
| 6128 * A flag indicating whether union types should be used. | 6129 * A flag indicating whether union types should be used. |
| 6129 */ | 6130 */ |
| 6130 bool enableUnionTypes = false; | 6131 bool enableUnionTypes = false; |
| 6131 | 6132 |
| 6132 /** | 6133 /** |
| 6133 * A flag indicating whether union types should have strict semantics. This op
tion has no effect | 6134 * A flag indicating whether union types should have strict semantics. This |
| 6134 * when `enabledUnionTypes` is `false`. | 6135 * option has no effect when `enabledUnionTypes` is `false`. |
| 6135 */ | 6136 */ |
| 6136 bool strictUnionTypes = false; | 6137 bool strictUnionTypes = false; |
| 6137 | 6138 |
| 6139 AnalysisEngine._(); |
| 6140 |
| 6138 /** | 6141 /** |
| 6139 * Return the instrumentation service that is to be used by this analysis | 6142 * Return the instrumentation service that is to be used by this analysis |
| 6140 * engine. | 6143 * engine. |
| 6141 */ | 6144 */ |
| 6142 InstrumentationService get instrumentationService => _instrumentationService; | 6145 InstrumentationService get instrumentationService => _instrumentationService; |
| 6143 | 6146 |
| 6144 /** | 6147 /** |
| 6145 * Set the instrumentation service that is to be used by this analysis engine | 6148 * Set the instrumentation service that is to be used by this analysis engine |
| 6146 * to the given [service]. | 6149 * to the given [service]. |
| 6147 */ | 6150 */ |
| 6148 void set instrumentationService(InstrumentationService service) { | 6151 void set instrumentationService(InstrumentationService service) { |
| 6149 if (service == null) { | 6152 if (service == null) { |
| 6150 _instrumentationService = InstrumentationService.NULL_SERVICE; | 6153 _instrumentationService = InstrumentationService.NULL_SERVICE; |
| 6151 } else { | 6154 } else { |
| 6152 _instrumentationService = service; | 6155 _instrumentationService = service; |
| 6153 } | 6156 } |
| 6154 } | 6157 } |
| 6155 | 6158 |
| 6156 /** | 6159 /** |
| 6157 * Return the logger that should receive information about errors within the a
nalysis engine. | 6160 * Return the logger that should receive information about errors within the |
| 6158 * | 6161 * analysis engine. |
| 6159 * @return the logger that should receive information about errors within the
analysis engine | |
| 6160 */ | 6162 */ |
| 6161 Logger get logger => _logger; | 6163 Logger get logger => _logger; |
| 6162 | 6164 |
| 6163 /** | 6165 /** |
| 6164 * Set the logger that should receive information about errors within the anal
ysis engine to the | 6166 * Set the logger that should receive information about errors within the |
| 6165 * given logger. | 6167 * analysis engine to the given [logger]. |
| 6166 * | |
| 6167 * @param logger the logger that should receive information about errors withi
n the analysis | |
| 6168 * engine | |
| 6169 */ | 6168 */ |
| 6170 void set logger(Logger logger) { | 6169 void set logger(Logger logger) { |
| 6171 this._logger = logger == null ? Logger.NULL : logger; | 6170 this._logger = logger == null ? Logger.NULL : logger; |
| 6172 } | 6171 } |
| 6173 | 6172 |
| 6174 /** | 6173 /** |
| 6175 * Clear any caches holding on to analysis results so that a full re-analysis
will be performed | 6174 * Clear any caches holding on to analysis results so that a full re-analysis |
| 6176 * the next time an analysis context is created. | 6175 * will be performed the next time an analysis context is created. |
| 6177 */ | 6176 */ |
| 6178 void clearCaches() { | 6177 void clearCaches() { |
| 6179 partitionManager.clearCache(); | 6178 partitionManager.clearCache(); |
| 6180 } | 6179 } |
| 6181 | 6180 |
| 6182 /** | 6181 /** |
| 6183 * Create a new context in which analysis can be performed. | 6182 * Create and return a new context in which analysis can be performed. |
| 6184 * | |
| 6185 * @return the analysis context that was created | |
| 6186 */ | 6183 */ |
| 6187 AnalysisContext createAnalysisContext() { | 6184 AnalysisContext createAnalysisContext() { |
| 6188 return new AnalysisContextImpl(); | 6185 return new AnalysisContextImpl(); |
| 6189 } | 6186 } |
| 6190 | 6187 |
| 6191 /** | 6188 /** |
| 6192 * Return `true` if the given file name is assumed to contain Dart source code
. | 6189 * Return `true` if the given [fileName] is assumed to contain Dart source |
| 6193 * | 6190 * code. |
| 6194 * @param fileName the name of the file being tested | |
| 6195 * @return `true` if the given file name is assumed to contain Dart source cod
e | |
| 6196 */ | 6191 */ |
| 6197 static bool isDartFileName(String fileName) { | 6192 static bool isDartFileName(String fileName) { |
| 6198 if (fileName == null) { | 6193 if (fileName == null) { |
| 6199 return false; | 6194 return false; |
| 6200 } | 6195 } |
| 6201 return javaStringEqualsIgnoreCase( | 6196 return javaStringEqualsIgnoreCase( |
| 6202 FileNameUtilities.getExtension(fileName), SUFFIX_DART); | 6197 FileNameUtilities.getExtension(fileName), SUFFIX_DART); |
| 6203 } | 6198 } |
| 6204 | 6199 |
| 6205 /** | 6200 /** |
| 6206 * Return `true` if the given file name is assumed to contain HTML. | 6201 * Return `true` if the given [fileName] is assumed to contain HTML. |
| 6207 * | |
| 6208 * @param fileName the name of the file being tested | |
| 6209 * @return `true` if the given file name is assumed to contain HTML | |
| 6210 */ | 6202 */ |
| 6211 static bool isHtmlFileName(String fileName) { | 6203 static bool isHtmlFileName(String fileName) { |
| 6212 if (fileName == null) { | 6204 if (fileName == null) { |
| 6213 return false; | 6205 return false; |
| 6214 } | 6206 } |
| 6215 String extension = FileNameUtilities.getExtension(fileName); | 6207 String extension = FileNameUtilities.getExtension(fileName); |
| 6216 return javaStringEqualsIgnoreCase(extension, SUFFIX_HTML) || | 6208 return javaStringEqualsIgnoreCase(extension, SUFFIX_HTML) || |
| 6217 javaStringEqualsIgnoreCase(extension, SUFFIX_HTM); | 6209 javaStringEqualsIgnoreCase(extension, SUFFIX_HTM); |
| 6218 } | 6210 } |
| 6219 } | 6211 } |
| (...skipping 6020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12240 visitElement(Element element) { | 12232 visitElement(Element element) { |
| 12241 if (element.id == _id) { | 12233 if (element.id == _id) { |
| 12242 result = element; | 12234 result = element; |
| 12243 throw new _ElementByIdFinderException(); | 12235 throw new _ElementByIdFinderException(); |
| 12244 } | 12236 } |
| 12245 super.visitElement(element); | 12237 super.visitElement(element); |
| 12246 } | 12238 } |
| 12247 } | 12239 } |
| 12248 | 12240 |
| 12249 class _ElementByIdFinderException {} | 12241 class _ElementByIdFinderException {} |
| OLD | NEW |