| 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.source; | 3 library engine.source; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'sdk.dart' show DartSdk; | 5 import 'sdk.dart' show DartSdk; |
| 6 import 'engine.dart' show AnalysisContext; | 6 import 'engine.dart' show AnalysisContext; |
| 7 /** | 7 /** |
| 8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains
t an existing | 8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains
t an existing |
| 9 * [Source]. | 9 * [Source]. |
| 10 * | 10 * |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 * A 'dart:' URI. | 434 * A 'dart:' URI. |
| 435 */ | 435 */ |
| 436 static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64); | 436 static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64); |
| 437 | 437 |
| 438 /** | 438 /** |
| 439 * A 'file:' URI. | 439 * A 'file:' URI. |
| 440 */ | 440 */ |
| 441 static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66); | 441 static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66); |
| 442 | 442 |
| 443 /** | 443 /** |
| 444 * A 'package:' URI referencing source package itself. |
| 445 */ |
| 446 static final UriKind PACKAGE_SELF_URI = new UriKind('PACKAGE_SELF_URI', 2, 0x7
3); |
| 447 |
| 448 /** |
| 444 * A 'package:' URI. | 449 * A 'package:' URI. |
| 445 */ | 450 */ |
| 446 static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 2, 0x70); | 451 static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 3, 0x70); |
| 447 static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_URI]; | 452 static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_SELF_URI, PAC
KAGE_URI]; |
| 448 | |
| 449 /** | |
| 450 * The single character encoding used to identify this kind of URI. | |
| 451 */ | |
| 452 int encoding = 0; | |
| 453 | |
| 454 /** | |
| 455 * Initialize a newly created URI kind to have the given encoding. | |
| 456 * | |
| 457 * @param encoding the single character encoding used to identify this kind of
URI. | |
| 458 */ | |
| 459 UriKind(String name, int ordinal, int encoding) : super(name, ordinal) { | |
| 460 this.encoding = encoding; | |
| 461 } | |
| 462 | 453 |
| 463 /** | 454 /** |
| 464 * Return the URI kind represented by the given encoding, or `null` if there i
s no kind with | 455 * Return the URI kind represented by the given encoding, or `null` if there i
s no kind with |
| 465 * the given encoding. | 456 * the given encoding. |
| 466 * | 457 * |
| 467 * @param encoding the single character encoding used to identify the URI kind
to be returned | 458 * @param encoding the single character encoding used to identify the URI kind
to be returned |
| 468 * @return the URI kind represented by the given encoding | 459 * @return the URI kind represented by the given encoding |
| 469 */ | 460 */ |
| 470 static UriKind fromEncoding(int encoding) { | 461 static UriKind fromEncoding(int encoding) { |
| 471 while (true) { | 462 while (true) { |
| 472 if (encoding == 0x64) { | 463 if (encoding == 0x64) { |
| 473 return DART_URI; | 464 return DART_URI; |
| 474 } else if (encoding == 0x66) { | 465 } else if (encoding == 0x66) { |
| 475 return FILE_URI; | 466 return FILE_URI; |
| 467 } else if (encoding == 0x73) { |
| 468 return PACKAGE_SELF_URI; |
| 476 } else if (encoding == 0x70) { | 469 } else if (encoding == 0x70) { |
| 477 return PACKAGE_URI; | 470 return PACKAGE_URI; |
| 478 } | 471 } |
| 479 break; | 472 break; |
| 480 } | 473 } |
| 481 return null; | 474 return null; |
| 482 } | 475 } |
| 476 |
| 477 /** |
| 478 * The single character encoding used to identify this kind of URI. |
| 479 */ |
| 480 int encoding = 0; |
| 481 |
| 482 /** |
| 483 * Initialize a newly created URI kind to have the given encoding. |
| 484 * |
| 485 * @param encoding the single character encoding used to identify this kind of
URI. |
| 486 */ |
| 487 UriKind(String name, int ordinal, int encoding) : super(name, ordinal) { |
| 488 this.encoding = encoding; |
| 489 } |
| 483 } | 490 } |
| 484 /** | 491 /** |
| 485 * A source range defines an [Element]'s source coordinates relative to its [Sou
rce]. | 492 * A source range defines an [Element]'s source coordinates relative to its [Sou
rce]. |
| 486 * | 493 * |
| 487 * @coverage dart.engine.utilities | 494 * @coverage dart.engine.utilities |
| 488 */ | 495 */ |
| 489 class SourceRange { | 496 class SourceRange { |
| 490 | 497 |
| 491 /** | 498 /** |
| 492 * The 0-based index of the first character of the source code for this elemen
t, relative to the | 499 * The 0-based index of the first character of the source code for this elemen
t, relative to the |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 if (contents == null) { | 801 if (contents == null) { |
| 795 _stampMap.remove(source); | 802 _stampMap.remove(source); |
| 796 return _contentMap.remove(source) != null; | 803 return _contentMap.remove(source) != null; |
| 797 } else { | 804 } else { |
| 798 _stampMap[source] = JavaSystem.currentTimeMillis(); | 805 _stampMap[source] = JavaSystem.currentTimeMillis(); |
| 799 String originalContents = javaMapPut(_contentMap, source, contents); | 806 String originalContents = javaMapPut(_contentMap, source, contents); |
| 800 return contents != originalContents; | 807 return contents != originalContents; |
| 801 } | 808 } |
| 802 } | 809 } |
| 803 } | 810 } |
| OLD | NEW |