| 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.sdk.io; | 3 library engine.sdk.io; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'java_io.dart'; | 5 import 'java_io.dart'; |
| 6 import 'java_engine_io.dart'; | 6 import 'java_engine_io.dart'; |
| 7 import 'source_io.dart'; | 7 import 'source_io.dart'; |
| 8 import 'error.dart'; | 8 import 'error.dart'; |
| 9 import 'scanner.dart'; | 9 import 'scanner.dart'; |
| 10 import 'ast.dart'; | 10 import 'ast.dart'; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 */ | 145 */ |
| 146 static DirectoryBasedDartSdk get defaultSdk { | 146 static DirectoryBasedDartSdk get defaultSdk { |
| 147 JavaFile sdkDirectory = defaultSdkDirectory; | 147 JavaFile sdkDirectory = defaultSdkDirectory; |
| 148 if (sdkDirectory == null) { | 148 if (sdkDirectory == null) { |
| 149 return null; | 149 return null; |
| 150 } | 150 } |
| 151 return new DirectoryBasedDartSdk(sdkDirectory); | 151 return new DirectoryBasedDartSdk(sdkDirectory); |
| 152 } | 152 } |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * Return the default Dart SDK, or `null` if the directory containing the defa
ult SDK cannot |
| 156 * be determined (or does not exist). |
| 157 * |
| 158 * Added in order to test AnalysisContextImpl2. |
| 159 * |
| 160 * @return the default Dart SDK |
| 161 */ |
| 162 static DirectoryBasedDartSdk get defaultSdk2 { |
| 163 JavaFile sdkDirectory = defaultSdkDirectory; |
| 164 if (sdkDirectory == null) { |
| 165 return null; |
| 166 } |
| 167 return new DirectoryBasedDartSdk.con1(sdkDirectory, true); |
| 168 } |
| 169 |
| 170 /** |
| 155 * Return the default directory for the Dart SDK, or `null` if the directory c
annot be | 171 * Return the default directory for the Dart SDK, or `null` if the directory c
annot be |
| 156 * determined (or does not exist). The default directory is provided by a [Sys
tem] property | 172 * determined (or does not exist). The default directory is provided by a [Sys
tem] property |
| 157 * named `com.google.dart.sdk`, or, if the property is not defined, an environ
ment variable | 173 * named `com.google.dart.sdk`, or, if the property is not defined, an environ
ment variable |
| 158 * named `DART_SDK`. | 174 * named `DART_SDK`. |
| 159 * | 175 * |
| 160 * @return the default directory for the Dart SDK | 176 * @return the default directory for the Dart SDK |
| 161 */ | 177 */ |
| 162 static JavaFile get defaultSdkDirectory { | 178 static JavaFile get defaultSdkDirectory { |
| 163 String sdkProperty = JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NA
ME); | 179 String sdkProperty = JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NA
ME); |
| 164 if (sdkProperty == null) { | 180 if (sdkProperty == null) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 176 | 192 |
| 177 /** | 193 /** |
| 178 * Initialize a newly created SDK to represent the Dart SDK installed in the g
iven directory. | 194 * Initialize a newly created SDK to represent the Dart SDK installed in the g
iven directory. |
| 179 * | 195 * |
| 180 * @param sdkDirectory the directory containing the SDK | 196 * @param sdkDirectory the directory containing the SDK |
| 181 */ | 197 */ |
| 182 DirectoryBasedDartSdk(JavaFile sdkDirectory) { | 198 DirectoryBasedDartSdk(JavaFile sdkDirectory) { |
| 183 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); | 199 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); |
| 184 initializeSdk(); | 200 initializeSdk(); |
| 185 initializeLibraryMap(); | 201 initializeLibraryMap(); |
| 186 _analysisContext = new AnalysisContextImpl(); | 202 if (AnalysisEngine.instance.useExperimentalContext) { |
| 203 _analysisContext = new AnalysisContextImpl2(); |
| 204 } else { |
| 205 _analysisContext = new AnalysisContextImpl(); |
| 206 } |
| 187 _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver
(this)]); | 207 _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver
(this)]); |
| 188 List<String> uris = this.uris; | 208 List<String> uris = this.uris; |
| 189 ChangeSet changeSet = new ChangeSet(); | 209 ChangeSet changeSet = new ChangeSet(); |
| 210 for (String uri in uris) { |
| 211 changeSet.added(_analysisContext.sourceFactory.forUri(uri)); |
| 212 } |
| 213 _analysisContext.applyChanges(changeSet); |
| 214 } |
| 215 |
| 216 /** |
| 217 * Initialize a newly created SDK to represent the Dart SDK installed in the g
iven directory. |
| 218 * |
| 219 * Added in order to test AnalysisContextImpl2. |
| 220 * |
| 221 * @param sdkDirectory the directory containing the SDK |
| 222 */ |
| 223 DirectoryBasedDartSdk.con1(JavaFile sdkDirectory, bool ignored) { |
| 224 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); |
| 225 initializeSdk(); |
| 226 initializeLibraryMap(); |
| 227 _analysisContext = new AnalysisContextImpl2(); |
| 228 _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver
(this)]); |
| 229 List<String> uris = this.uris; |
| 230 ChangeSet changeSet = new ChangeSet(); |
| 190 for (String uri in uris) { | 231 for (String uri in uris) { |
| 191 changeSet.added(_analysisContext.sourceFactory.forUri(uri)); | 232 changeSet.added(_analysisContext.sourceFactory.forUri(uri)); |
| 192 } | 233 } |
| 193 _analysisContext.applyChanges(changeSet); | 234 _analysisContext.applyChanges(changeSet); |
| 194 } | 235 } |
| 195 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) => new F
ileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind); | 236 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) => new F
ileBasedSource.con2(contentCache, new JavaFile.fromUri(uri), kind); |
| 196 AnalysisContext get context => _analysisContext; | 237 AnalysisContext get context => _analysisContext; |
| 197 | 238 |
| 198 /** | 239 /** |
| 199 * Return the file containing the Dartium executable, or `null` if it does not
exist. | 240 * Return the file containing the Dartium executable, or `null` if it does not
exist. |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 return null; | 576 return null; |
| 536 } | 577 } |
| 537 } | 578 } |
| 538 class AnalysisErrorListener_9 implements AnalysisErrorListener { | 579 class AnalysisErrorListener_9 implements AnalysisErrorListener { |
| 539 List<bool> foundError; | 580 List<bool> foundError; |
| 540 AnalysisErrorListener_9(this.foundError); | 581 AnalysisErrorListener_9(this.foundError); |
| 541 void onError(AnalysisError error) { | 582 void onError(AnalysisError error) { |
| 542 foundError[0] = true; | 583 foundError[0] = true; |
| 543 } | 584 } |
| 544 } | 585 } |
| OLD | NEW |