Chromium Code Reviews| 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.sdk.io; | 8 library engine.sdk.io; |
| 9 | 9 |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 if (!sdkDirectory.exists()) { | 166 if (!sdkDirectory.exists()) { |
| 167 return null; | 167 return null; |
| 168 } | 168 } |
| 169 return sdkDirectory; | 169 return sdkDirectory; |
| 170 } | 170 } |
| 171 | 171 |
| 172 /** | 172 /** |
| 173 * Initialize a newly created SDK to represent the Dart SDK installed in the g iven directory. | 173 * Initialize a newly created SDK to represent the Dart SDK installed in the g iven directory. |
| 174 * | 174 * |
| 175 * @param sdkDirectory the directory containing the SDK | 175 * @param sdkDirectory the directory containing the SDK |
| 176 */ | |
| 177 DirectoryBasedDartSdk(JavaFile sdkDirectory) : this.con1(sdkDirectory, false); | |
| 178 | |
| 179 /** | |
| 180 * Initialize a newly created SDK to represent the Dart SDK installed in the g iven directory. | |
| 181 * | |
| 182 * @param sdkDirectory the directory containing the SDK | |
| 183 * @param useDart2jsPaths `true` if the dart2js path should be used when it is available | 176 * @param useDart2jsPaths `true` if the dart2js path should be used when it is available |
| 184 */ | 177 */ |
| 185 DirectoryBasedDartSdk.con1(JavaFile sdkDirectory, bool useDart2jsPaths) { | 178 DirectoryBasedDartSdk(JavaFile sdkDirectory, [bool useDart2jsPaths = false]) { |
|
Brian Wilkerson
2014/03/09 23:43:15
Very cool!
| |
| 186 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); | 179 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); |
| 187 _initializeSdk(); | 180 _initializeSdk(); |
| 188 _initializeLibraryMap(useDart2jsPaths); | 181 _initializeLibraryMap(useDart2jsPaths); |
| 189 _analysisContext = new AnalysisContextImpl(); | 182 _analysisContext = new AnalysisContextImpl(); |
| 190 _analysisContext.sourceFactory = new SourceFactory([new DartUriResolver(this )]); | 183 _analysisContext.sourceFactory = new SourceFactory([new DartUriResolver(this )]); |
| 191 List<String> uris = this.uris; | 184 List<String> uris = this.uris; |
| 192 ChangeSet changeSet = new ChangeSet(); | 185 ChangeSet changeSet = new ChangeSet(); |
| 193 for (String uri in uris) { | 186 for (String uri in uris) { |
| 194 changeSet.addedSource(_analysisContext.sourceFactory.forUri(uri)); | 187 changeSet.addedSource(_analysisContext.sourceFactory.forUri(uri)); |
| 195 } | 188 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 Parser parser = new Parser(source, errorListener); | 460 Parser parser = new Parser(source, errorListener); |
| 468 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); | 461 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); |
| 469 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li braryBuilder(_useDart2jsPaths); | 462 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li braryBuilder(_useDart2jsPaths); |
| 470 // If any syntactic errors were found then don't try to visit the AST struct ure. | 463 // If any syntactic errors were found then don't try to visit the AST struct ure. |
| 471 if (!errorListener.errorReported) { | 464 if (!errorListener.errorReported) { |
| 472 unit.accept(libraryBuilder); | 465 unit.accept(libraryBuilder); |
| 473 } | 466 } |
| 474 return libraryBuilder.librariesMap; | 467 return libraryBuilder.librariesMap; |
| 475 } | 468 } |
| 476 } | 469 } |
| OLD | NEW |