| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 int get length; | 349 int get length; |
| 350 | 350 |
| 351 /** | 351 /** |
| 352 * Offset of the element code relative to the beginning of the file. | 352 * Offset of the element code relative to the beginning of the file. |
| 353 */ | 353 */ |
| 354 @Id(0) | 354 @Id(0) |
| 355 int get offset; | 355 int get offset; |
| 356 } | 356 } |
| 357 | 357 |
| 358 /** | 358 /** |
| 359 * Summary information about a reference to a an entity such as a type, top | 359 * Summary information about a reference to an entity such as a type, top level |
| 360 * level executable, or executable within a class. | 360 * executable, or executable within a class. |
| 361 */ | 361 */ |
| 362 abstract class EntityRef extends base.SummaryClass { | 362 abstract class EntityRef extends base.SummaryClass { |
| 363 /** | 363 /** |
| 364 * If this is a reference to a function type implicitly defined by a | 364 * If this is a reference to a function type implicitly defined by a |
| 365 * function-typed parameter, a list of zero-based indices indicating the path | 365 * function-typed parameter, a list of zero-based indices indicating the path |
| 366 * from the entity referred to by [reference] to the appropriate type | 366 * from the entity referred to by [reference] to the appropriate type |
| 367 * parameter. Otherwise the empty list. | 367 * parameter. Otherwise the empty list. |
| 368 * | 368 * |
| 369 * If there are N indices in this list, then the entity being referred to is | 369 * If there are N indices in this list, then the entity being referred to is |
| 370 * the function type implicitly defined by a function-typed parameter of a | 370 * the function type implicitly defined by a function-typed parameter of a |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 */ | 441 */ |
| 442 @Id(5) | 442 @Id(5) |
| 443 EntityRef get syntheticReturnType; | 443 EntityRef get syntheticReturnType; |
| 444 | 444 |
| 445 /** | 445 /** |
| 446 * If this is an instantiation of a generic type or generic executable, the | 446 * If this is an instantiation of a generic type or generic executable, the |
| 447 * type arguments used to instantiate it (if any). | 447 * type arguments used to instantiate it (if any). |
| 448 */ | 448 */ |
| 449 @Id(1) | 449 @Id(1) |
| 450 List<EntityRef> get typeArguments; | 450 List<EntityRef> get typeArguments; |
| 451 |
| 452 /** |
| 453 * If this is a function type, the type parameters defined for the function |
| 454 * type (if any). |
| 455 */ |
| 456 @Id(7) |
| 457 List<UnlinkedTypeParam> get typeParameters; |
| 451 } | 458 } |
| 452 | 459 |
| 453 /** | 460 /** |
| 454 * Enum used to indicate the kind of a name in index. | 461 * Enum used to indicate the kind of a name in index. |
| 455 */ | 462 */ |
| 456 enum IndexNameKind { | 463 enum IndexNameKind { |
| 457 /** | 464 /** |
| 458 * A top-level element. | 465 * A top-level element. |
| 459 */ | 466 */ |
| 460 topLevel, | 467 topLevel, |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 966 |
| 960 /** | 967 /** |
| 961 * Each item of this list corresponds to a unique referenced element. It is | 968 * Each item of this list corresponds to a unique referenced element. It is |
| 962 * the kind of the synthetic element. | 969 * the kind of the synthetic element. |
| 963 */ | 970 */ |
| 964 @Id(5) | 971 @Id(5) |
| 965 List<IndexSyntheticElementKind> get elementKinds; | 972 List<IndexSyntheticElementKind> get elementKinds; |
| 966 | 973 |
| 967 /** | 974 /** |
| 968 * Each item of this list corresponds to a unique referenced element. It is | 975 * Each item of this list corresponds to a unique referenced element. It is |
| 969 * the identifier of the class member element name, or `null` if the element i
s | 976 * the identifier of the class member element name, or `null` if the element |
| 970 * a top-level element. The list is sorted in ascending order, so that the | 977 * is a top-level element. The list is sorted in ascending order, so that the |
| 971 * client can quickly check whether an element is referenced in this | 978 * client can quickly check whether an element is referenced in this |
| 972 * [PackageIndex]. | 979 * [PackageIndex]. |
| 973 */ | 980 */ |
| 974 @Id(7) | 981 @Id(7) |
| 975 List<int> get elementNameClassMemberIds; | 982 List<int> get elementNameClassMemberIds; |
| 976 | 983 |
| 977 /** | 984 /** |
| 978 * Each item of this list corresponds to a unique referenced element. It is | 985 * Each item of this list corresponds to a unique referenced element. It is |
| 979 * the identifier of the named parameter name, or `null` if the element is not | 986 * the identifier of the named parameter name, or `null` if the element is not |
| 980 * a named parameter. The list is sorted in ascending order, so that the | 987 * a named parameter. The list is sorted in ascending order, so that the |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 */ | 1096 */ |
| 1090 prefix, | 1097 prefix, |
| 1091 | 1098 |
| 1092 /** | 1099 /** |
| 1093 * The entity being referred to does not exist. | 1100 * The entity being referred to does not exist. |
| 1094 */ | 1101 */ |
| 1095 unresolved | 1102 unresolved |
| 1096 } | 1103 } |
| 1097 | 1104 |
| 1098 /** | 1105 /** |
| 1106 * Enum used to indicate the style of a typedef. |
| 1107 */ |
| 1108 enum TypedefStyle { |
| 1109 /** |
| 1110 * A typedef that defines a non-generic function type. The syntax is |
| 1111 * ``` |
| 1112 * 'typedef' returnType? identifier typeParameters? formalParameterList ';' |
| 1113 * ``` |
| 1114 * The typedef can have type parameters associated with it, but the function |
| 1115 * type that results from applying type arguments does not. |
| 1116 */ |
| 1117 functionType, |
| 1118 |
| 1119 /** |
| 1120 * A typedef that defines a generic function type. The syntax is |
| 1121 * ``` |
| 1122 * typeAlias ::= |
| 1123 * 'typedef' identifier typeParameters? '=' genericFunctionType ';' |
| 1124 * genericFunctionType ::= |
| 1125 * returnType? 'Function' typeParameters? parameterTypeList |
| 1126 * ``` |
| 1127 * Both the typedef itself and the function type that results from applying |
| 1128 * type arguments can have type parameters. |
| 1129 */ |
| 1130 genericFunctionType |
| 1131 } |
| 1132 |
| 1133 /** |
| 1099 * Index information about a unit in a [PackageIndex]. | 1134 * Index information about a unit in a [PackageIndex]. |
| 1100 */ | 1135 */ |
| 1101 abstract class UnitIndex extends base.SummaryClass { | 1136 abstract class UnitIndex extends base.SummaryClass { |
| 1102 /** | 1137 /** |
| 1103 * Each item of this list is the kind of an element defined in this unit. | 1138 * Each item of this list is the kind of an element defined in this unit. |
| 1104 */ | 1139 */ |
| 1105 @Id(6) | 1140 @Id(6) |
| 1106 List<IndexNameKind> get definedNameKinds; | 1141 List<IndexNameKind> get definedNameKinds; |
| 1107 | 1142 |
| 1108 /** | 1143 /** |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 * Pop the top n values from the stack (where n is obtained from | 2155 * Pop the top n values from the stack (where n is obtained from |
| 2121 * [UnlinkedExpr.ints]), place them in a [List], and push the result back | 2156 * [UnlinkedExpr.ints]), place them in a [List], and push the result back |
| 2122 * onto the stack. The type parameter for the [List] is obtained from | 2157 * onto the stack. The type parameter for the [List] is obtained from |
| 2123 * [UnlinkedExpr.references]. | 2158 * [UnlinkedExpr.references]. |
| 2124 */ | 2159 */ |
| 2125 makeTypedList, | 2160 makeTypedList, |
| 2126 | 2161 |
| 2127 /** | 2162 /** |
| 2128 * Pop the top 2*n values from the stack (where n is obtained from | 2163 * Pop the top 2*n values from the stack (where n is obtained from |
| 2129 * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a | 2164 * [UnlinkedExpr.ints]), interpret them as key/value pairs, place them in a |
| 2130 * [Map], and push the result back onto the stack. The two type parameters fo
r | 2165 * [Map], and push the result back onto the stack. The two type parameters |
| 2131 * the [Map] are obtained from [UnlinkedExpr.references]. | 2166 * for the [Map] are obtained from [UnlinkedExpr.references]. |
| 2132 */ | 2167 */ |
| 2133 makeTypedMap, | 2168 makeTypedMap, |
| 2134 | 2169 |
| 2135 /** | 2170 /** |
| 2136 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the | 2171 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the |
| 2137 * result back onto the stack. | 2172 * result back onto the stack. |
| 2138 */ | 2173 */ |
| 2139 equal, | 2174 equal, |
| 2140 | 2175 |
| 2141 /** | 2176 /** |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2611 * unique within this compilation unit. If this id is found in | 2646 * unique within this compilation unit. If this id is found in |
| 2612 * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits | 2647 * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits |
| 2613 * `@covariant` behavior from a base class. | 2648 * `@covariant` behavior from a base class. |
| 2614 * | 2649 * |
| 2615 * Otherwise, zero. | 2650 * Otherwise, zero. |
| 2616 */ | 2651 */ |
| 2617 @Id(14) | 2652 @Id(14) |
| 2618 int get inheritsCovariantSlot; | 2653 int get inheritsCovariantSlot; |
| 2619 | 2654 |
| 2620 /** | 2655 /** |
| 2621 * The synthetic initializer function of the parameter. Absent if the variabl
e | 2656 * The synthetic initializer function of the parameter. Absent if the |
| 2622 * does not have an initializer. | 2657 * variable does not have an initializer. |
| 2623 */ | 2658 */ |
| 2624 @Id(12) | 2659 @Id(12) |
| 2625 UnlinkedExecutable get initializer; | 2660 UnlinkedExecutable get initializer; |
| 2626 | 2661 |
| 2627 /** | 2662 /** |
| 2628 * Indicates whether this parameter is explicitly marked as being covariant. | 2663 * Indicates whether this parameter is explicitly marked as being covariant. |
| 2629 */ | 2664 */ |
| 2630 @Id(15) | 2665 @Id(15) |
| 2631 bool get isExplicitlyCovariant; | 2666 bool get isExplicitlyCovariant; |
| 2632 | 2667 |
| 2633 /** | 2668 /** |
| 2634 * Indicates whether the parameter is declared using the `final` keyword. | 2669 * Indicates whether the parameter is declared using the `final` keyword. |
| 2635 */ | 2670 */ |
| 2636 @Id(16) | 2671 @Id(16) |
| 2637 bool get isFinal; | 2672 bool get isFinal; |
| 2638 | 2673 |
| 2639 /** | 2674 /** |
| 2640 * Indicates whether this is a function-typed parameter. | 2675 * Indicates whether this is a function-typed parameter. A parameter is |
| 2676 * function-typed if the declaration of the parameter has explicit formal |
| 2677 * parameters |
| 2678 * ``` |
| 2679 * int functionTyped(int p) |
| 2680 * ``` |
| 2681 * but is not function-typed if it does not, even if the type of the parameter |
| 2682 * is a function type. |
| 2641 */ | 2683 */ |
| 2642 @Id(5) | 2684 @Id(5) |
| 2643 bool get isFunctionTyped; | 2685 bool get isFunctionTyped; |
| 2644 | 2686 |
| 2645 /** | 2687 /** |
| 2646 * Indicates whether this is an initializing formal parameter (i.e. it is | 2688 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 2647 * declared using `this.` syntax). | 2689 * declared using `this.` syntax). |
| 2648 */ | 2690 */ |
| 2649 @Id(6) | 2691 @Id(6) |
| 2650 bool get isInitializingFormal; | 2692 bool get isInitializingFormal; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2879 @Id(1) | 2921 @Id(1) |
| 2880 int get nameOffset; | 2922 int get nameOffset; |
| 2881 | 2923 |
| 2882 /** | 2924 /** |
| 2883 * Parameters of the executable, if any. | 2925 * Parameters of the executable, if any. |
| 2884 */ | 2926 */ |
| 2885 @Id(3) | 2927 @Id(3) |
| 2886 List<UnlinkedParam> get parameters; | 2928 List<UnlinkedParam> get parameters; |
| 2887 | 2929 |
| 2888 /** | 2930 /** |
| 2889 * Return type of the typedef. | 2931 * If [style] is [TypedefStyle.functionType], the return type of the typedef. |
| 2932 * If [style] is [TypedefStyle.genericFunctionType], the function type being |
| 2933 * defined. |
| 2890 */ | 2934 */ |
| 2891 @Id(2) | 2935 @Id(2) |
| 2892 EntityRef get returnType; | 2936 EntityRef get returnType; |
| 2893 | 2937 |
| 2894 /** | 2938 /** |
| 2939 * The style of the typedef. |
| 2940 */ |
| 2941 @Id(8) |
| 2942 TypedefStyle get style; |
| 2943 |
| 2944 /** |
| 2895 * Type parameters of the typedef, if any. | 2945 * Type parameters of the typedef, if any. |
| 2896 */ | 2946 */ |
| 2897 @Id(5) | 2947 @Id(5) |
| 2898 List<UnlinkedTypeParam> get typeParameters; | 2948 List<UnlinkedTypeParam> get typeParameters; |
| 2899 } | 2949 } |
| 2900 | 2950 |
| 2901 /** | 2951 /** |
| 2902 * Unlinked summary information about a type parameter declaration. | 2952 * Unlinked summary information about a type parameter declaration. |
| 2903 */ | 2953 */ |
| 2904 abstract class UnlinkedTypeParam extends base.SummaryClass { | 2954 abstract class UnlinkedTypeParam extends base.SummaryClass { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3194 @Id(11) | 3244 @Id(11) |
| 3195 int get visibleLength; | 3245 int get visibleLength; |
| 3196 | 3246 |
| 3197 /** | 3247 /** |
| 3198 * If a local variable, the beginning of the visible range; zero otherwise. | 3248 * If a local variable, the beginning of the visible range; zero otherwise. |
| 3199 */ | 3249 */ |
| 3200 @informative | 3250 @informative |
| 3201 @Id(12) | 3251 @Id(12) |
| 3202 int get visibleOffset; | 3252 int get visibleOffset; |
| 3203 } | 3253 } |
| OLD | NEW |