| 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 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 * is unique within the compilation unit) identifying the target of type | 76 * is unique within the compilation unit) identifying the target of type |
| 77 * propagation or type inference with which this [EntityRef] is associated. | 77 * propagation or type inference with which this [EntityRef] is associated. |
| 78 * | 78 * |
| 79 * Otherwise zero. | 79 * Otherwise zero. |
| 80 */ | 80 */ |
| 81 int slot; | 81 int slot; |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * Index into [UnlinkedUnit.references] for the entity being referred to, or | 84 * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| 85 * zero if this is a reference to a type parameter. | 85 * zero if this is a reference to a type parameter. |
| 86 * | |
| 87 * Note that since zero is also a valid index into | |
| 88 * [UnlinkedUnit.references], we cannot distinguish between references to | |
| 89 * type parameters and references to other entities by checking [reference] | |
| 90 * against zero. To distinguish between references to type parameters and | |
| 91 * references to other entities, check whether [paramReference] is zero. | |
| 92 */ | 86 */ |
| 93 int reference; | 87 int reference; |
| 94 | 88 |
| 95 /** | 89 /** |
| 96 * If this is a reference to a type parameter, one-based index into the list | 90 * If this is a reference to a type parameter, one-based index into the list |
| 97 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De | 91 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 98 * Bruijn index conventions; that is, innermost parameters come first, and | 92 * Bruijn index conventions; that is, innermost parameters come first, and |
| 99 * if a class or method has multiple parameters, they are indexed from right | 93 * if a class or method has multiple parameters, they are indexed from right |
| 100 * to left. So for instance, if the enclosing declaration is | 94 * to left. So for instance, if the enclosing declaration is |
| 101 * | 95 * |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 int unit; | 245 int unit; |
| 252 | 246 |
| 253 /** | 247 /** |
| 254 * If the entity being referred to is generic, the number of type parameters | 248 * If the entity being referred to is generic, the number of type parameters |
| 255 * it accepts. Otherwise zero. | 249 * it accepts. Otherwise zero. |
| 256 */ | 250 */ |
| 257 int numTypeParameters; | 251 int numTypeParameters; |
| 258 | 252 |
| 259 /** | 253 /** |
| 260 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 254 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 261 * name of the entity being referred to. The empty string refers to the | 255 * name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 262 * pseudo-type `dynamic`. | 256 * string is "dynamic". |
| 263 */ | 257 */ |
| 264 String name; | 258 String name; |
| 265 } | 259 } |
| 266 | 260 |
| 267 /** | 261 /** |
| 268 * Linked summary of a compilation unit. | 262 * Linked summary of a compilation unit. |
| 269 */ | 263 */ |
| 270 class LinkedUnit { | 264 class LinkedUnit { |
| 271 /** | 265 /** |
| 272 * Information about the resolution of references within the compilation | 266 * Information about the resolution of references within the compilation |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 */ | 1188 */ |
| 1195 List<String> parts; | 1189 List<String> parts; |
| 1196 } | 1190 } |
| 1197 | 1191 |
| 1198 /** | 1192 /** |
| 1199 * Unlinked summary information about a name referred to in one library that | 1193 * Unlinked summary information about a name referred to in one library that |
| 1200 * might be defined in another. | 1194 * might be defined in another. |
| 1201 */ | 1195 */ |
| 1202 class UnlinkedReference { | 1196 class UnlinkedReference { |
| 1203 /** | 1197 /** |
| 1204 * Name of the entity being referred to. The empty string refers to the | 1198 * Name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 1205 * pseudo-type `dynamic`. | 1199 * string is "dynamic". |
| 1206 */ | 1200 */ |
| 1207 String name; | 1201 String name; |
| 1208 | 1202 |
| 1209 /** | 1203 /** |
| 1210 * Prefix used to refer to the entity, or zero if no prefix is used. This is | 1204 * Prefix used to refer to the entity, or zero if no prefix is used. This is |
| 1211 * an index into [UnlinkedUnit.references]. | 1205 * an index into [UnlinkedUnit.references]. |
| 1212 * | 1206 * |
| 1213 * Prefix references must always point backward; that is, for all i, if | 1207 * Prefix references must always point backward; that is, for all i, if |
| 1214 * UnlinkedUnit.references[i].prefixReference != 0, then | 1208 * UnlinkedUnit.references[i].prefixReference != 0, then |
| 1215 * UnlinkedUnit.references[i].prefixReference < i. | 1209 * UnlinkedUnit.references[i].prefixReference < i. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 @informative | 1302 @informative |
| 1309 UnlinkedDocumentationComment libraryDocumentationComment; | 1303 UnlinkedDocumentationComment libraryDocumentationComment; |
| 1310 | 1304 |
| 1311 /** | 1305 /** |
| 1312 * Unlinked public namespace of this compilation unit. | 1306 * Unlinked public namespace of this compilation unit. |
| 1313 */ | 1307 */ |
| 1314 UnlinkedPublicNamespace publicNamespace; | 1308 UnlinkedPublicNamespace publicNamespace; |
| 1315 | 1309 |
| 1316 /** | 1310 /** |
| 1317 * Top level and prefixed names referred to by this compilation unit. The | 1311 * Top level and prefixed names referred to by this compilation unit. The |
| 1318 * zeroth element of this array is always populated and always represents a | 1312 * zeroth element of this array is always populated and is used to represent |
| 1319 * reference to the pseudo-type "dynamic". | 1313 * the absence of a reference in places where a reference is optional (for |
| 1314 * example [UnlinkedReference.prefixReference or |
| 1315 * UnlinkedImport.prefixReference]). |
| 1320 */ | 1316 */ |
| 1321 List<UnlinkedReference> references; | 1317 List<UnlinkedReference> references; |
| 1322 | 1318 |
| 1323 /** | 1319 /** |
| 1324 * Classes declared in the compilation unit. | 1320 * Classes declared in the compilation unit. |
| 1325 */ | 1321 */ |
| 1326 List<UnlinkedClass> classes; | 1322 List<UnlinkedClass> classes; |
| 1327 | 1323 |
| 1328 /** | 1324 /** |
| 1329 * Enums declared in the compilation unit. | 1325 * Enums declared in the compilation unit. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 /** | 1420 /** |
| 1425 * If this variable is propagable, nonzero slot id identifying which entry in | 1421 * If this variable is propagable, nonzero slot id identifying which entry in |
| 1426 * [LinkedLibrary.types] contains the propagated type for this variable. If | 1422 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 1427 * there is no matching entry in [LinkedLibrary.types], then this variable's | 1423 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 1428 * propagated type is the same as its declared type. | 1424 * propagated type is the same as its declared type. |
| 1429 * | 1425 * |
| 1430 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 1426 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 1431 */ | 1427 */ |
| 1432 int propagatedTypeSlot; | 1428 int propagatedTypeSlot; |
| 1433 } | 1429 } |
| OLD | NEW |