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

Side by Side Diff: pkg/analyzer/tool/summary/idl.dart

Issue 1625543002: Use the explicit string 'void' to refer to void in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « pkg/analyzer/test/src/summary/summary_common.dart ('k') | 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 is not 6 * This file is an "idl" style description of the summary format. It is not
7 * executed directly; instead it is parsed and transformed into code that 7 * executed directly; instead it is parsed and transformed into code that
8 * implements the summary format. 8 * implements the summary format.
9 * 9 *
10 * The code generation process introduces the following non-typical semantics: 10 * The code generation process introduces the following non-typical semantics:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 * library. The summary of the defining compilation unit is listed first, 177 * library. The summary of the defining compilation unit is listed first,
178 * followed by the summary of each part, in the order of the `part` 178 * followed by the summary of each part, in the order of the `part`
179 * declarations in the defining compilation unit. 179 * declarations in the defining compilation unit.
180 */ 180 */
181 List<LinkedUnit> units; 181 List<LinkedUnit> units;
182 182
183 /** 183 /**
184 * The libraries that this library depends on (either via an explicit import 184 * The libraries that this library depends on (either via an explicit import
185 * statement or via the implicit dependencies on `dart:core` and 185 * statement or via the implicit dependencies on `dart:core` and
186 * `dart:async`). The first element of this array is a pseudo-dependency 186 * `dart:async`). The first element of this array is a pseudo-dependency
187 * representing the library itself (it is also used for "dynamic"). This is 187 * representing the library itself (it is also used for `dynamic` and
188 * followed by elements representing "prelinked" dependencies (direct imports 188 * `void`). This is followed by elements representing "prelinked"
189 * and the transitive closure of exports). After the prelinked dependencies 189 * dependencies (direct imports and the transitive closure of exports).
190 * are elements represent "linked" dependencies. 190 * After the prelinked dependencies are elements representing "linked"
191 * dependencies.
191 * 192 *
192 * A library is only included as a "linked" dependency if it is a true 193 * A library is only included as a "linked" dependency if it is a true
193 * dependency (e.g. a propagated or inferred type or constant value 194 * dependency (e.g. a propagated or inferred type or constant value
194 * implicitly refers to an element declared in the library) or 195 * implicitly refers to an element declared in the library) or
195 * anti-dependency (e.g. the result of type propagation or type inference 196 * anti-dependency (e.g. the result of type propagation or type inference
196 * depends on the lack of a certain declaration in the library). 197 * depends on the lack of a certain declaration in the library).
197 */ 198 */
198 List<LinkedDependency> dependencies; 199 List<LinkedDependency> dependencies;
199 200
200 /** 201 /**
(...skipping 23 matching lines...) Expand all
224 * Information about the resolution of an [UnlinkedReference]. 225 * Information about the resolution of an [UnlinkedReference].
225 */ 226 */
226 class LinkedReference { 227 class LinkedReference {
227 /** 228 /**
228 * Index into [LinkedLibrary.dependencies] indicating which imported library 229 * Index into [LinkedLibrary.dependencies] indicating which imported library
229 * declares the entity being referred to. 230 * declares the entity being referred to.
230 */ 231 */
231 int dependency; 232 int dependency;
232 233
233 /** 234 /**
234 * The kind of the entity being referred to. For the pseudo-type `dynamic`, 235 * The kind of the entity being referred to. For the pseudo-types `dynamic`
235 * the kind is [ReferenceKind.classOrEnum]. 236 * and `void`, the kind is [ReferenceKind.classOrEnum].
236 */ 237 */
237 ReferenceKind kind; 238 ReferenceKind kind;
238 239
239 /** 240 /**
240 * Integer index indicating which unit in the imported library contains the 241 * Integer index indicating which unit in the imported library contains the
241 * definition of the entity. As with indices into [LinkedLibrary.units], 242 * definition of the entity. As with indices into [LinkedLibrary.units],
242 * zero represents the defining compilation unit, and nonzero values 243 * zero represents the defining compilation unit, and nonzero values
243 * represent parts in the order of the corresponding `part` declarations. 244 * represent parts in the order of the corresponding `part` declarations.
244 */ 245 */
245 int unit; 246 int unit;
246 247
247 /** 248 /**
248 * If the entity being referred to is generic, the number of type parameters 249 * If the entity being referred to is generic, the number of type parameters
249 * it accepts. Otherwise zero. 250 * it accepts. Otherwise zero.
250 */ 251 */
251 int numTypeParameters; 252 int numTypeParameters;
252 253
253 /** 254 /**
254 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], 255 * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
255 * name of the entity being referred to. For the pseudo-type `dynamic`, the 256 * name of the entity being referred to. For the pseudo-type `dynamic`, the
256 * string is "dynamic". 257 * string is "dynamic". For the pseudo-type `void`, the string is "void".
257 */ 258 */
258 String name; 259 String name;
259 } 260 }
260 261
261 /** 262 /**
262 * Linked summary of a compilation unit. 263 * Linked summary of a compilation unit.
263 */ 264 */
264 class LinkedUnit { 265 class LinkedUnit {
265 /** 266 /**
266 * Information about the resolution of references within the compilation 267 * Information about the resolution of references within the compilation
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 @informative 851 @informative
851 UnlinkedDocumentationComment documentationComment; 852 UnlinkedDocumentationComment documentationComment;
852 853
853 /** 854 /**
854 * Type parameters of the executable, if any. Empty if support for generic 855 * Type parameters of the executable, if any. Empty if support for generic
855 * method syntax is disabled. 856 * method syntax is disabled.
856 */ 857 */
857 List<UnlinkedTypeParam> typeParameters; 858 List<UnlinkedTypeParam> typeParameters;
858 859
859 /** 860 /**
860 * Declared return type of the executable. Absent if the return type is 861 * Declared return type of the executable. Absent if the executable is a
861 * `void` or the executable is a constructor. Note that when strong mode is 862 * constructor. Note that when strong mode is enabled, the actual return
862 * enabled, the actual return type may be different due to type inference. 863 * type may be different due to type inference.
863 */ 864 */
864 EntityRef returnType; 865 EntityRef returnType;
865 866
866 /** 867 /**
867 * Parameters of the executable, if any. Note that getters have no 868 * Parameters of the executable, if any. Note that getters have no
868 * parameters (hence this will be the empty list), and setters have a single 869 * parameters (hence this will be the empty list), and setters have a single
869 * parameter. 870 * parameter.
870 */ 871 */
871 List<UnlinkedParam> parameters; 872 List<UnlinkedParam> parameters;
872 873
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 String name; 1051 String name;
1051 1052
1052 /** 1053 /**
1053 * Offset of the parameter name relative to the beginning of the file. 1054 * Offset of the parameter name relative to the beginning of the file.
1054 */ 1055 */
1055 @informative 1056 @informative
1056 int nameOffset; 1057 int nameOffset;
1057 1058
1058 /** 1059 /**
1059 * If [isFunctionTyped] is `true`, the declared return type. If 1060 * If [isFunctionTyped] is `true`, the declared return type. If
1060 * [isFunctionTyped] is `false`, the declared type. Absent if 1061 * [isFunctionTyped] is `false`, the declared type.
1061 * [isFunctionTyped] is `true` and the declared return type is `void`. Note
1062 * that when strong mode is enabled, the actual type may be different due to
1063 * type inference.
1064 */ 1062 */
1065 EntityRef type; 1063 EntityRef type;
1066 1064
1067 /** 1065 /**
1068 * If [isFunctionTyped] is `true`, the parameters of the function type. 1066 * If [isFunctionTyped] is `true`, the parameters of the function type.
1069 */ 1067 */
1070 List<UnlinkedParam> parameters; 1068 List<UnlinkedParam> parameters;
1071 1069
1072 /** 1070 /**
1073 * Kind of the parameter. 1071 * Kind of the parameter.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 List<String> parts; 1187 List<String> parts;
1190 } 1188 }
1191 1189
1192 /** 1190 /**
1193 * Unlinked summary information about a name referred to in one library that 1191 * Unlinked summary information about a name referred to in one library that
1194 * might be defined in another. 1192 * might be defined in another.
1195 */ 1193 */
1196 class UnlinkedReference { 1194 class UnlinkedReference {
1197 /** 1195 /**
1198 * Name of the entity being referred to. For the pseudo-type `dynamic`, the 1196 * Name of the entity being referred to. For the pseudo-type `dynamic`, the
1199 * string is "dynamic". 1197 * string is "dynamic". For the pseudo-type `void`, the string is "void".
1200 */ 1198 */
1201 String name; 1199 String name;
1202 1200
1203 /** 1201 /**
1204 * Prefix used to refer to the entity, or zero if no prefix is used. This is 1202 * Prefix used to refer to the entity, or zero if no prefix is used. This is
1205 * an index into [UnlinkedUnit.references]. 1203 * an index into [UnlinkedUnit.references].
1206 * 1204 *
1207 * Prefix references must always point backward; that is, for all i, if 1205 * Prefix references must always point backward; that is, for all i, if
1208 * UnlinkedUnit.references[i].prefixReference != 0, then 1206 * UnlinkedUnit.references[i].prefixReference != 0, then
1209 * UnlinkedUnit.references[i].prefixReference < i. 1207 * UnlinkedUnit.references[i].prefixReference < i.
(...skipping 22 matching lines...) Expand all
1232 */ 1230 */
1233 @informative 1231 @informative
1234 UnlinkedDocumentationComment documentationComment; 1232 UnlinkedDocumentationComment documentationComment;
1235 1233
1236 /** 1234 /**
1237 * Type parameters of the typedef, if any. 1235 * Type parameters of the typedef, if any.
1238 */ 1236 */
1239 List<UnlinkedTypeParam> typeParameters; 1237 List<UnlinkedTypeParam> typeParameters;
1240 1238
1241 /** 1239 /**
1242 * Return type of the typedef. Absent if the return type is `void`. 1240 * Return type of the typedef.
1243 */ 1241 */
1244 EntityRef returnType; 1242 EntityRef returnType;
1245 1243
1246 /** 1244 /**
1247 * Parameters of the executable, if any. 1245 * Parameters of the executable, if any.
1248 */ 1246 */
1249 List<UnlinkedParam> parameters; 1247 List<UnlinkedParam> parameters;
1250 } 1248 }
1251 1249
1252 /** 1250 /**
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 /** 1418 /**
1421 * If this variable is propagable, nonzero slot id identifying which entry in 1419 * If this variable is propagable, nonzero slot id identifying which entry in
1422 * [LinkedLibrary.types] contains the propagated type for this variable. If 1420 * [LinkedLibrary.types] contains the propagated type for this variable. If
1423 * there is no matching entry in [LinkedLibrary.types], then this variable's 1421 * there is no matching entry in [LinkedLibrary.types], then this variable's
1424 * propagated type is the same as its declared type. 1422 * propagated type is the same as its declared type.
1425 * 1423 *
1426 * Non-propagable variables have a [propagatedTypeSlot] of zero. 1424 * Non-propagable variables have a [propagatedTypeSlot] of zero.
1427 */ 1425 */
1428 int propagatedTypeSlot; 1426 int propagatedTypeSlot;
1429 } 1427 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/summary_common.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698