Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 2719353002: First cut at idl changes (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
Paul Berry 2017/02/28 20:43:56 Nit: I would describe this as "A typedef that defi
Brian Wilkerson 2017/03/07 17:20:32 In the process of shortening the line below I thin
Paul Berry 2017/03/07 17:56:21 I still think it's confusing to say "A typedef tha
Brian Wilkerson 2017/03/07 18:21:40 Ok, that seems like a better alternative, so I upd
1121 * ```
1122 * 'typedef' identifier typeParameters? '=' returnType? 'Function' typeParamet ers? parameterTypeList ';'
Paul Berry 2017/02/28 20:43:56 Nit: long line.
1123 * ```
1124 * Both the typedef itself and the function type that results from applying
1125 * type arguments can have type parameters.
1126 */
1127 genericFunctionType
1128 }
1129
1130 /**
1099 * Index information about a unit in a [PackageIndex]. 1131 * Index information about a unit in a [PackageIndex].
1100 */ 1132 */
1101 abstract class UnitIndex extends base.SummaryClass { 1133 abstract class UnitIndex extends base.SummaryClass {
1102 /** 1134 /**
1103 * Each item of this list is the kind of an element defined in this unit. 1135 * Each item of this list is the kind of an element defined in this unit.
1104 */ 1136 */
1105 @Id(6) 1137 @Id(6)
1106 List<IndexNameKind> get definedNameKinds; 1138 List<IndexNameKind> get definedNameKinds;
1107 1139
1108 /** 1140 /**
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 @Id(15) 2662 @Id(15)
2631 bool get isExplicitlyCovariant; 2663 bool get isExplicitlyCovariant;
2632 2664
2633 /** 2665 /**
2634 * Indicates whether the parameter is declared using the `final` keyword. 2666 * Indicates whether the parameter is declared using the `final` keyword.
2635 */ 2667 */
2636 @Id(16) 2668 @Id(16)
2637 bool get isFinal; 2669 bool get isFinal;
2638 2670
2639 /** 2671 /**
2640 * Indicates whether this is a function-typed parameter. 2672 * Indicates whether this is a function-typed parameter. A parameter is
2673 * function-typed if the declaration of the parameter has explicit formal
2674 * parameters
2675 * ```
2676 * int functionTyped(int p)
2677 * ```
2678 * but is not function-typed if it does not, even if the type of the parameter
2679 * is a function type.
2641 */ 2680 */
2642 @Id(5) 2681 @Id(5)
2643 bool get isFunctionTyped; 2682 bool get isFunctionTyped;
2644 2683
2645 /** 2684 /**
2646 * Indicates whether this is an initializing formal parameter (i.e. it is 2685 * Indicates whether this is an initializing formal parameter (i.e. it is
2647 * declared using `this.` syntax). 2686 * declared using `this.` syntax).
2648 */ 2687 */
2649 @Id(6) 2688 @Id(6)
2650 bool get isInitializingFormal; 2689 bool get isInitializingFormal;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 @Id(1) 2918 @Id(1)
2880 int get nameOffset; 2919 int get nameOffset;
2881 2920
2882 /** 2921 /**
2883 * Parameters of the executable, if any. 2922 * Parameters of the executable, if any.
2884 */ 2923 */
2885 @Id(3) 2924 @Id(3)
2886 List<UnlinkedParam> get parameters; 2925 List<UnlinkedParam> get parameters;
2887 2926
2888 /** 2927 /**
2889 * Return type of the typedef. 2928 * If [isGenericFunctionType] is `false`, the return type of the typedef. If
2929 * [isGenericFunctionType] is `true`, the function type being defined.
Brian Wilkerson 2017/02/28 20:28:49 Just noticed that this comment is out of date. Wil
2890 */ 2930 */
2891 @Id(2) 2931 @Id(2)
2892 EntityRef get returnType; 2932 EntityRef get returnType;
2893 2933
2894 /** 2934 /**
2935 * The style of the typedef.
2936 */
2937 @Id(8)
2938 TypedefStyle get style;
2939
2940 /**
2895 * Type parameters of the typedef, if any. 2941 * Type parameters of the typedef, if any.
2896 */ 2942 */
2897 @Id(5) 2943 @Id(5)
2898 List<UnlinkedTypeParam> get typeParameters; 2944 List<UnlinkedTypeParam> get typeParameters;
2899 } 2945 }
2900 2946
2901 /** 2947 /**
2902 * Unlinked summary information about a type parameter declaration. 2948 * Unlinked summary information about a type parameter declaration.
2903 */ 2949 */
2904 abstract class UnlinkedTypeParam extends base.SummaryClass { 2950 abstract class UnlinkedTypeParam extends base.SummaryClass {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 @Id(11) 3240 @Id(11)
3195 int get visibleLength; 3241 int get visibleLength;
3196 3242
3197 /** 3243 /**
3198 * If a local variable, the beginning of the visible range; zero otherwise. 3244 * If a local variable, the beginning of the visible range; zero otherwise.
3199 */ 3245 */
3200 @informative 3246 @informative
3201 @Id(12) 3247 @Id(12)
3202 int get visibleOffset; 3248 int get visibleOffset;
3203 } 3249 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698