| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 * "compiler/compiler.dart", | 426 * "compiler/compiler.dart", |
| 427 * category: "Tools", | 427 * category: "Tools", |
| 428 * platforms: 0), | 428 * platforms: 0), |
| 429 * }; | 429 * }; |
| 430 * </pre> | 430 * </pre> |
| 431 */ | 431 */ |
| 432 class SdkLibrariesReader { | 432 class SdkLibrariesReader { |
| 433 /** | 433 /** |
| 434 * A flag indicating whether the dart2js path should be used when it is availa
ble. | 434 * A flag indicating whether the dart2js path should be used when it is availa
ble. |
| 435 */ | 435 */ |
| 436 bool _useDart2jsPaths = false; | 436 final bool _useDart2jsPaths; |
| 437 | 437 |
| 438 /** | 438 /** |
| 439 * Initialize a newly created library reader to use the dart2js path if the gi
ven value is | 439 * Initialize a newly created library reader to use the dart2js path if the gi
ven value is |
| 440 * `true`. | 440 * `true`. |
| 441 * | 441 * |
| 442 * @param useDart2jsPaths `true` if the dart2js path should be used when it is
available | 442 * @param useDart2jsPaths `true` if the dart2js path should be used when it is
available |
| 443 */ | 443 */ |
| 444 SdkLibrariesReader(bool useDart2jsPaths) { | 444 SdkLibrariesReader(this._useDart2jsPaths); |
| 445 this._useDart2jsPaths = useDart2jsPaths; | |
| 446 } | |
| 447 | 445 |
| 448 /** | 446 /** |
| 449 * Return the library map read from the given source. | 447 * Return the library map read from the given source. |
| 450 * | 448 * |
| 451 * @param file the [File] of the library file | 449 * @param file the [File] of the library file |
| 452 * @param libraryFileContents the contents from the library file | 450 * @param libraryFileContents the contents from the library file |
| 453 * @return the library map read from the given source | 451 * @return the library map read from the given source |
| 454 */ | 452 */ |
| 455 LibraryMap readFromFile(JavaFile file, String libraryFileContents) => readFrom
Source(new FileBasedSource.con2(file, UriKind.FILE_URI), libraryFileContents); | 453 LibraryMap readFromFile(JavaFile file, String libraryFileContents) => readFrom
Source(new FileBasedSource.con2(file, UriKind.FILE_URI), libraryFileContents); |
| 456 | 454 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 467 Parser parser = new Parser(source, errorListener); | 465 Parser parser = new Parser(source, errorListener); |
| 468 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); | 466 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); |
| 469 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li
braryBuilder(_useDart2jsPaths); | 467 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. | 468 // If any syntactic errors were found then don't try to visit the AST struct
ure. |
| 471 if (!errorListener.errorReported) { | 469 if (!errorListener.errorReported) { |
| 472 unit.accept(libraryBuilder); | 470 unit.accept(libraryBuilder); |
| 473 } | 471 } |
| 474 return libraryBuilder.librariesMap; | 472 return libraryBuilder.librariesMap; |
| 475 } | 473 } |
| 476 } | 474 } |
| OLD | NEW |