| 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 23 matching lines...) Expand all Loading... |
| 34 * | 34 * |
| 35 * Since we expect "linked" and "prelinked" dependencies to be similar, we only | 35 * Since we expect "linked" and "prelinked" dependencies to be similar, we only |
| 36 * rarely distinguish between them; most information is that is not "unlinked" | 36 * rarely distinguish between them; most information is that is not "unlinked" |
| 37 * is typically considered "linked" for simplicity. | 37 * is typically considered "linked" for simplicity. |
| 38 * | 38 * |
| 39 * Except as otherwise noted, synthetic elements are not stored in the summary; | 39 * Except as otherwise noted, synthetic elements are not stored in the summary; |
| 40 * they are re-synthesized at the time the summary is read. | 40 * they are re-synthesized at the time the summary is read. |
| 41 */ | 41 */ |
| 42 library analyzer.tool.summary.idl; | 42 library analyzer.tool.summary.idl; |
| 43 | 43 |
| 44 import 'package:analyzer/dart/element/element.dart'; |
| 45 |
| 44 import 'base.dart' as base; | 46 import 'base.dart' as base; |
| 45 import 'base.dart' show Id, TopLevel; | 47 import 'base.dart' show Id, TopLevel; |
| 46 import 'format.dart' as generated; | 48 import 'format.dart' as generated; |
| 47 import 'package:analyzer/dart/element/element.dart'; | |
| 48 | 49 |
| 49 /** | 50 /** |
| 50 * Annotation describing information which is not part of Dart semantics; in | 51 * Annotation describing information which is not part of Dart semantics; in |
| 51 * other words, if this information (or any information it refers to) changes, | 52 * other words, if this information (or any information it refers to) changes, |
| 52 * static analysis and runtime behavior of the library are unaffected. | 53 * static analysis and runtime behavior of the library are unaffected. |
| 53 * | 54 * |
| 54 * Information that has purely local effect (in other words, it does not affect | 55 * Information that has purely local effect (in other words, it does not affect |
| 55 * the API of the code being analyzed) is also marked as `informative`. | 56 * the API of the code being analyzed) is also marked as `informative`. |
| 56 */ | 57 */ |
| 57 const informative = null; | 58 const informative = null; |
| (...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 * that element onto the stack. | 1463 * that element onto the stack. |
| 1463 */ | 1464 */ |
| 1464 pushLocalFunctionReference, | 1465 pushLocalFunctionReference, |
| 1465 } | 1466 } |
| 1466 | 1467 |
| 1467 /** | 1468 /** |
| 1468 * Unlinked summary information about a constructor initializer. | 1469 * Unlinked summary information about a constructor initializer. |
| 1469 */ | 1470 */ |
| 1470 abstract class UnlinkedConstructorInitializer extends base.SummaryClass { | 1471 abstract class UnlinkedConstructorInitializer extends base.SummaryClass { |
| 1471 /** | 1472 /** |
| 1472 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the | |
| 1473 * invocation. Otherwise empty. | |
| 1474 */ | |
| 1475 @Id(3) | |
| 1476 List<UnlinkedConst> get arguments; | |
| 1477 | |
| 1478 /** | |
| 1479 * If there are `m` [arguments] and `n` [argumentNames], then each argument | 1473 * If there are `m` [arguments] and `n` [argumentNames], then each argument |
| 1480 * from [arguments] with index `i` such that `n + i - m >= 0`, should be used | 1474 * from [arguments] with index `i` such that `n + i - m >= 0`, should be used |
| 1481 * with the name at `n + i - m`. | 1475 * with the name at `n + i - m`. |
| 1482 */ | 1476 */ |
| 1483 @Id(4) | 1477 @Id(4) |
| 1484 List<String> get argumentNames; | 1478 List<String> get argumentNames; |
| 1485 | 1479 |
| 1486 /** | 1480 /** |
| 1481 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the |
| 1482 * invocation. Otherwise empty. |
| 1483 */ |
| 1484 @Id(3) |
| 1485 List<UnlinkedConst> get arguments; |
| 1486 |
| 1487 /** |
| 1487 * If [kind] is `field`, the expression of the field initializer. | 1488 * If [kind] is `field`, the expression of the field initializer. |
| 1488 * Otherwise `null`. | 1489 * Otherwise `null`. |
| 1489 */ | 1490 */ |
| 1490 @Id(1) | 1491 @Id(1) |
| 1491 UnlinkedConst get expression; | 1492 UnlinkedConst get expression; |
| 1492 | 1493 |
| 1493 /** | 1494 /** |
| 1494 * The kind of the constructor initializer (field, redirect, super). | 1495 * The kind of the constructor initializer (field, redirect, super). |
| 1495 */ | 1496 */ |
| 1496 @Id(2) | 1497 @Id(2) |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 * declaration. | 1631 * declaration. |
| 1631 */ | 1632 */ |
| 1632 abstract class UnlinkedExecutable extends base.SummaryClass { | 1633 abstract class UnlinkedExecutable extends base.SummaryClass { |
| 1633 /** | 1634 /** |
| 1634 * Annotations for this executable. | 1635 * Annotations for this executable. |
| 1635 */ | 1636 */ |
| 1636 @Id(6) | 1637 @Id(6) |
| 1637 List<UnlinkedConst> get annotations; | 1638 List<UnlinkedConst> get annotations; |
| 1638 | 1639 |
| 1639 /** | 1640 /** |
| 1641 * If this executable's function body is declared using `=>`, the expression |
| 1642 * to the right of the `=>`. May be omitted if neither type inference nor |
| 1643 * constant evaluation depends on the function body. |
| 1644 */ |
| 1645 @Id(29) |
| 1646 UnlinkedConst get bodyExpr; |
| 1647 |
| 1648 /** |
| 1640 * Code range of the executable. | 1649 * Code range of the executable. |
| 1641 */ | 1650 */ |
| 1642 @informative | 1651 @informative |
| 1643 @Id(26) | 1652 @Id(26) |
| 1644 CodeRange get codeRange; | 1653 CodeRange get codeRange; |
| 1645 | 1654 |
| 1646 /** | 1655 /** |
| 1647 * If a constant [UnlinkedExecutableKind.constructor], the constructor | 1656 * If a constant [UnlinkedExecutableKind.constructor], the constructor |
| 1648 * initializers. Otherwise empty. | 1657 * initializers. Otherwise empty. |
| 1649 */ | 1658 */ |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2614 /** | 2623 /** |
| 2615 * Annotations for this variable. | 2624 * Annotations for this variable. |
| 2616 */ | 2625 */ |
| 2617 @Id(8) | 2626 @Id(8) |
| 2618 List<UnlinkedConst> get annotations; | 2627 List<UnlinkedConst> get annotations; |
| 2619 | 2628 |
| 2620 /** | 2629 /** |
| 2621 * Code range of the variable. | 2630 * Code range of the variable. |
| 2622 */ | 2631 */ |
| 2623 @informative | 2632 @informative |
| 2624 @Id(14) | 2633 @Id(5) |
| 2625 CodeRange get codeRange; | 2634 CodeRange get codeRange; |
| 2626 | 2635 |
| 2627 /** | 2636 /** |
| 2628 * If [isConst] is true, and the variable has an initializer, the constant | |
| 2629 * expression in the initializer. Note that the presence of this expression | |
| 2630 * does not mean that it is a valid, check [UnlinkedConst.isInvalid]. | |
| 2631 */ | |
| 2632 @Id(5) | |
| 2633 UnlinkedConst get constExpr; | |
| 2634 | |
| 2635 /** | |
| 2636 * Documentation comment for the variable, or `null` if there is no | 2637 * Documentation comment for the variable, or `null` if there is no |
| 2637 * documentation comment. | 2638 * documentation comment. |
| 2638 */ | 2639 */ |
| 2639 @informative | 2640 @informative |
| 2640 @Id(10) | 2641 @Id(10) |
| 2641 UnlinkedDocumentationComment get documentationComment; | 2642 UnlinkedDocumentationComment get documentationComment; |
| 2642 | 2643 |
| 2643 /** | 2644 /** |
| 2644 * If this variable is inferable, nonzero slot id identifying which entry in | 2645 * If this variable is inferable, nonzero slot id identifying which entry in |
| 2645 * [LinkedLibrary.types] contains the inferred type for this variable. If | 2646 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 */ | 2714 */ |
| 2714 @Id(11) | 2715 @Id(11) |
| 2715 int get visibleLength; | 2716 int get visibleLength; |
| 2716 | 2717 |
| 2717 /** | 2718 /** |
| 2718 * If a local variable, the beginning of the visible range; zero otherwise. | 2719 * If a local variable, the beginning of the visible range; zero otherwise. |
| 2719 */ | 2720 */ |
| 2720 @Id(12) | 2721 @Id(12) |
| 2721 int get visibleOffset; | 2722 int get visibleOffset; |
| 2722 } | 2723 } |
| OLD | NEW |