Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /** | 5 /** |
| 6 * This file is an "idl" style description of the summary format. It | 6 * This file is an "idl" style description of the summary format. It |
| 7 * contains abstract classes which declare the interface for reading data from | 7 * contains abstract classes which declare the interface for reading data from |
| 8 * summaries. It is parsed and transformed into code that implements the | 8 * summaries. It is parsed and transformed into code that implements the |
| 9 * summary format. | 9 * summary format. |
| 10 * | 10 * |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 /** | 130 /** |
| 131 * If this is an instantiation of a generic type or generic executable, the | 131 * If this is an instantiation of a generic type or generic executable, the |
| 132 * type arguments used to instantiate it. Trailing type arguments of type | 132 * type arguments used to instantiate it. Trailing type arguments of type |
| 133 * `dynamic` are omitted. | 133 * `dynamic` are omitted. |
| 134 */ | 134 */ |
| 135 @Id(1) | 135 @Id(1) |
| 136 List<EntityRef> get typeArguments; | 136 List<EntityRef> get typeArguments; |
| 137 } | 137 } |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * TODO(scheglov) document | |
|
Paul Berry
2016/02/25 17:14:25
Please document this.
| |
| 141 */ | |
| 142 enum IndexRelationKind { | |
| 143 EXTEND, | |
| 144 IMPLEMENT, | |
| 145 MIXIN, | |
| 146 READ, | |
| 147 READ_WRITE, | |
| 148 WRITE, | |
| 149 INVOKE, | |
| 150 REFERENCE | |
| 151 } | |
| 152 | |
| 153 /** | |
| 140 * Information about a dependency that exists between one library and another | 154 * Information about a dependency that exists between one library and another |
| 141 * due to an "import" declaration. | 155 * due to an "import" declaration. |
| 142 */ | 156 */ |
| 143 abstract class LinkedDependency extends base.SummaryClass { | 157 abstract class LinkedDependency extends base.SummaryClass { |
| 144 /** | 158 /** |
| 145 * URI for the compilation units listed in the library's `part` declarations. | 159 * URI for the compilation units listed in the library's `part` declarations. |
| 146 * These URIs are relative to the importing library. | 160 * These URIs are relative to the importing library. |
| 147 */ | 161 */ |
| 148 @Id(1) | 162 @Id(1) |
| 149 List<String> get parts; | 163 List<String> get parts; |
| 150 | 164 |
| 151 /** | 165 /** |
| 152 * The relative URI of the dependent library. This URI is relative to the | 166 * The relative URI of the dependent library. This URI is relative to the |
| 153 * importing library, even if there are intervening `export` declarations. | 167 * importing library, even if there are intervening `export` declarations. |
| 154 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports | 168 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports |
| 155 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be | 169 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be |
| 156 * `b/d/e.dart`. | 170 * `b/d/e.dart`. |
| 157 */ | 171 */ |
| 158 @Id(0) | 172 @Id(0) |
| 159 String get uri; | 173 String get uri; |
| 160 } | 174 } |
| 161 | 175 |
| 162 /** | 176 /** |
| 177 * TODO(scheglov) document | |
|
Paul Berry
2016/02/25 17:14:25
Remove this.
| |
| 178 */ | |
| 179 /** | |
| 163 * Information about a single name in the export namespace of the library that | 180 * Information about a single name in the export namespace of the library that |
| 164 * is not in the public namespace. | 181 * is not in the public namespace. |
| 165 */ | 182 */ |
| 166 abstract class LinkedExportName extends base.SummaryClass { | 183 abstract class LinkedExportName extends base.SummaryClass { |
| 167 /** | 184 /** |
| 168 * Index into [LinkedLibrary.dependencies] for the library in which the | 185 * Index into [LinkedLibrary.dependencies] for the library in which the |
| 169 * entity is defined. | 186 * entity is defined. |
| 170 */ | 187 */ |
| 171 @Id(0) | 188 @Id(0) |
| 172 int get dependency; | 189 int get dependency; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 List<UnlinkedUnit> get unlinkedUnits; | 405 List<UnlinkedUnit> get unlinkedUnits; |
| 389 | 406 |
| 390 /** | 407 /** |
| 391 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. | 408 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. |
| 392 */ | 409 */ |
| 393 @Id(3) | 410 @Id(3) |
| 394 List<String> get unlinkedUnitUris; | 411 List<String> get unlinkedUnitUris; |
| 395 } | 412 } |
| 396 | 413 |
| 397 /** | 414 /** |
| 415 * Index information about a package. | |
| 416 */ | |
| 417 @topLevel | |
| 418 abstract class PackageIndex extends base.SummaryClass { | |
| 419 factory PackageIndex.fromBuffer(List<int> buffer) => | |
| 420 generated.readPackageIndex(buffer); | |
| 421 | |
| 422 /** | |
| 423 * Each item of this list corresponds to a unique library URI with an element | |
| 424 * referenced in the [PackageIndex]. It is index into [uris] list. | |
|
Paul Berry
2016/02/25 17:14:25
s/It is index/It is an index/
| |
| 425 */ | |
| 426 @Id(2) | |
| 427 List<int> get elementLibraryUris; | |
| 428 | |
| 429 /** | |
| 430 * Each item of this list corresponds to a unique referenced element. It is | |
| 431 * the offset of the element name relative to the beginning of the file. The | |
| 432 * list is sorted in ascending order, so that the client can quickly check | |
| 433 * whether an element is referenced in this [PackageIndex]. | |
| 434 */ | |
| 435 @Id(1) | |
| 436 List<int> get elementOffsets; | |
| 437 | |
| 438 /** | |
| 439 * Each item of this list corresponds to a unique referenced element. It is | |
| 440 * the index into [elementLibraryUris] and [elementUnitUris] for the library | |
| 441 * specific unit where the element is declared. | |
| 442 */ | |
| 443 @Id(0) | |
| 444 List<int> get elementUnits; | |
| 445 | |
| 446 /** | |
| 447 * Each item of this list corresponds to a unique unit URI with an element | |
| 448 * referenced in the [PackageIndex]. It is index into [uris] list. | |
| 449 */ | |
| 450 @Id(3) | |
| 451 List<int> get elementUnitUris; | |
| 452 | |
| 453 /** | |
| 454 * List of unit indexed in this [PackageIndex]. | |
|
Paul Berry
2016/02/25 17:14:25
s/unit/units/
| |
| 455 */ | |
| 456 @Id(5) | |
| 457 List<UnitIndex> get units; | |
| 458 | |
| 459 /** | |
| 460 * List of unique URIs used in this [PackageIndex]. | |
| 461 */ | |
| 462 @Id(4) | |
| 463 List<String> get uris; | |
| 464 } | |
| 465 | |
| 466 /** | |
| 398 * Enum used to indicate the kind of entity referred to by a | 467 * Enum used to indicate the kind of entity referred to by a |
| 399 * [LinkedReference]. | 468 * [LinkedReference]. |
| 400 */ | 469 */ |
| 401 enum ReferenceKind { | 470 enum ReferenceKind { |
| 402 /** | 471 /** |
| 403 * The entity is a class or enum. | 472 * The entity is a class or enum. |
| 404 */ | 473 */ |
| 405 classOrEnum, | 474 classOrEnum, |
| 406 | 475 |
| 407 /** | 476 /** |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 */ | 525 */ |
| 457 prefix, | 526 prefix, |
| 458 | 527 |
| 459 /** | 528 /** |
| 460 * The entity being referred to does not exist. | 529 * The entity being referred to does not exist. |
| 461 */ | 530 */ |
| 462 unresolved | 531 unresolved |
| 463 } | 532 } |
| 464 | 533 |
| 465 /** | 534 /** |
| 535 * Index information about a unit in a [PackageIndex]. | |
| 536 */ | |
| 537 abstract class UnitIndex extends base.SummaryClass { | |
| 538 /** | |
| 539 * Each item of this list is the index into [PackageIndex.elementUnits] and | |
| 540 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so | |
| 541 * that the client can quickly find element references in this [UnitIndex]. | |
| 542 */ | |
| 543 @Id(4) | |
| 544 List<int> get elements; | |
| 545 | |
| 546 /** | |
| 547 * Each item of this list is the kind of the element usage. | |
| 548 */ | |
| 549 @Id(5) | |
| 550 List<IndexRelationKind> get kinds; | |
| 551 | |
| 552 /** | |
| 553 * The library source URI of this unit, e.g. `dart:core` or | |
| 554 * `package:foo/bar.dart`, as index into [PackageIndex.uris]. | |
| 555 */ | |
| 556 @Id(0) | |
| 557 int get libraryUri; | |
| 558 | |
| 559 /** | |
| 560 * Each item of this list is the length of the element usage. | |
| 561 */ | |
| 562 @Id(2) | |
| 563 List<int> get locationLengths; | |
| 564 | |
| 565 /** | |
| 566 * Each item of this list is the offset of the element usage relative to the | |
| 567 * beginning of the file. | |
| 568 */ | |
| 569 @Id(3) | |
| 570 List<int> get locationOffsets; | |
| 571 | |
| 572 /** | |
| 573 * The unit source URI of this unit, e.g. `dart:core/int.dart` or | |
| 574 * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris]. | |
| 575 */ | |
| 576 @Id(1) | |
| 577 int get unitUri; | |
| 578 } | |
| 579 | |
| 580 /** | |
| 466 * Unlinked summary information about a class declaration. | 581 * Unlinked summary information about a class declaration. |
| 467 */ | 582 */ |
| 468 abstract class UnlinkedClass extends base.SummaryClass { | 583 abstract class UnlinkedClass extends base.SummaryClass { |
| 469 /** | 584 /** |
| 470 * Annotations for this class. | 585 * Annotations for this class. |
| 471 */ | 586 */ |
| 472 @Id(5) | 587 @Id(5) |
| 473 List<UnlinkedConst> get annotations; | 588 List<UnlinkedConst> get annotations; |
| 474 | 589 |
| 475 /** | 590 /** |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1992 */ | 2107 */ |
| 1993 @Id(11) | 2108 @Id(11) |
| 1994 int get visibleLength; | 2109 int get visibleLength; |
| 1995 | 2110 |
| 1996 /** | 2111 /** |
| 1997 * If a local variable, the beginning of the visible range; zero otherwise. | 2112 * If a local variable, the beginning of the visible range; zero otherwise. |
| 1998 */ | 2113 */ |
| 1999 @Id(12) | 2114 @Id(12) |
| 2000 int get visibleOffset; | 2115 int get visibleOffset; |
| 2001 } | 2116 } |
| OLD | NEW |