| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 * `a` is a prefix name and `b` is a class name. | 580 * `a` is a prefix name and `b` is a class name. |
| 581 * | 581 * |
| 582 * TODO(paulberry): figure out how to resolve this ambiguity in the | 582 * TODO(paulberry): figure out how to resolve this ambiguity in the |
| 583 * "prelinked" part of the summary. | 583 * "prelinked" part of the summary. |
| 584 */ | 584 */ |
| 585 invokeConstructor, | 585 invokeConstructor, |
| 586 | 586 |
| 587 /** | 587 /** |
| 588 * Pop the top n values from the stack (where n is obtained from | 588 * Pop the top n values from the stack (where n is obtained from |
| 589 * [UnlinkedConst.ints]), place them in a [List], and push the result back | 589 * [UnlinkedConst.ints]), place them in a [List], and push the result back |
| 590 * onto the stack. The type parameter for the [List] is implicitly `dynamic`. |
| 591 */ |
| 592 makeUntypedList, |
| 593 |
| 594 /** |
| 595 * Pop the top 2*n values from the stack (where n is obtained from |
| 596 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a |
| 597 * [Map], and push the result back onto the stack. The two type parameters |
| 598 * for the [Map] are implicitly `dynamic`. |
| 599 */ |
| 600 makeUntypedMap, |
| 601 |
| 602 /** |
| 603 * Pop the top n values from the stack (where n is obtained from |
| 604 * [UnlinkedConst.ints]), place them in a [List], and push the result back |
| 590 * onto the stack. The type parameter for the [List] is obtained from | 605 * onto the stack. The type parameter for the [List] is obtained from |
| 591 * [UnlinkedConst.references]. | 606 * [UnlinkedConst.references]. |
| 592 */ | 607 */ |
| 593 makeList, | 608 makeTypedList, |
| 594 | 609 |
| 595 /** | 610 /** |
| 596 * Pop the top 2*n values from the stack (where n is obtained from | 611 * Pop the top 2*n values from the stack (where n is obtained from |
| 597 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a | 612 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a |
| 598 * [Map], and push the result back onto the stack. The two type parameters fo
r | 613 * [Map], and push the result back onto the stack. The two type parameters fo
r |
| 599 * the [Map] are obtained from [UnlinkedConst.references]. | 614 * the [Map] are obtained from [UnlinkedConst.references]. |
| 600 */ | 615 */ |
| 601 makeMap, | 616 makeTypedMap, |
| 602 | 617 |
| 603 /** | 618 /** |
| 604 * Pop the top 2 values from the stack, pass them to the predefined Dart | 619 * Pop the top 2 values from the stack, pass them to the predefined Dart |
| 605 * function `identical`, and push the result back onto the stack. | 620 * function `identical`, and push the result back onto the stack. |
| 606 */ | 621 */ |
| 607 identical, | 622 identical, |
| 608 | 623 |
| 609 /** | 624 /** |
| 610 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the | 625 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the |
| 611 * result back onto the stack. | 626 * result back onto the stack. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 UnlinkedDocumentationComment documentationComment; | 867 UnlinkedDocumentationComment documentationComment; |
| 853 | 868 |
| 854 /** | 869 /** |
| 855 * Type parameters of the executable, if any. Empty if support for generic | 870 * Type parameters of the executable, if any. Empty if support for generic |
| 856 * method syntax is disabled. | 871 * method syntax is disabled. |
| 857 */ | 872 */ |
| 858 List<UnlinkedTypeParam> typeParameters; | 873 List<UnlinkedTypeParam> typeParameters; |
| 859 | 874 |
| 860 /** | 875 /** |
| 861 * Declared return type of the executable. Absent if the executable is a | 876 * Declared return type of the executable. Absent if the executable is a |
| 862 * constructor. Note that when strong mode is enabled, the actual return | 877 * constructor or the return type is implicit. |
| 863 * type may be different due to type inference. | |
| 864 */ | 878 */ |
| 865 EntityRef returnType; | 879 EntityRef returnType; |
| 866 | 880 |
| 867 /** | 881 /** |
| 868 * Parameters of the executable, if any. Note that getters have no | 882 * Parameters of the executable, if any. Note that getters have no |
| 869 * parameters (hence this will be the empty list), and setters have a single | 883 * parameters (hence this will be the empty list), and setters have a single |
| 870 * parameter. | 884 * parameter. |
| 871 */ | 885 */ |
| 872 List<UnlinkedParam> parameters; | 886 List<UnlinkedParam> parameters; |
| 873 | 887 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 895 * Indicates whether the executable is declared using the `const` keyword. | 909 * Indicates whether the executable is declared using the `const` keyword. |
| 896 */ | 910 */ |
| 897 bool isConst; | 911 bool isConst; |
| 898 | 912 |
| 899 /** | 913 /** |
| 900 * Indicates whether the executable is declared using the `factory` keyword. | 914 * Indicates whether the executable is declared using the `factory` keyword. |
| 901 */ | 915 */ |
| 902 bool isFactory; | 916 bool isFactory; |
| 903 | 917 |
| 904 /** | 918 /** |
| 905 * Indicates whether the executable lacks an explicit return type | |
| 906 * declaration. False for constructors and setters. | |
| 907 */ | |
| 908 bool hasImplicitReturnType; | |
| 909 | |
| 910 /** | |
| 911 * Indicates whether the executable is declared using the `external` keyword. | 919 * Indicates whether the executable is declared using the `external` keyword. |
| 912 */ | 920 */ |
| 913 bool isExternal; | 921 bool isExternal; |
| 914 } | 922 } |
| 915 | 923 |
| 916 /** | 924 /** |
| 917 * Enum used to indicate the kind of an executable. | 925 * Enum used to indicate the kind of an executable. |
| 918 */ | 926 */ |
| 919 enum UnlinkedExecutableKind { | 927 enum UnlinkedExecutableKind { |
| 920 /** | 928 /** |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 String name; | 1059 String name; |
| 1052 | 1060 |
| 1053 /** | 1061 /** |
| 1054 * Offset of the parameter name relative to the beginning of the file. | 1062 * Offset of the parameter name relative to the beginning of the file. |
| 1055 */ | 1063 */ |
| 1056 @informative | 1064 @informative |
| 1057 int nameOffset; | 1065 int nameOffset; |
| 1058 | 1066 |
| 1059 /** | 1067 /** |
| 1060 * If [isFunctionTyped] is `true`, the declared return type. If | 1068 * If [isFunctionTyped] is `true`, the declared return type. If |
| 1061 * [isFunctionTyped] is `false`, the declared type. | 1069 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 1070 * implicit. |
| 1062 */ | 1071 */ |
| 1063 EntityRef type; | 1072 EntityRef type; |
| 1064 | 1073 |
| 1065 /** | 1074 /** |
| 1066 * If [isFunctionTyped] is `true`, the parameters of the function type. | 1075 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 1067 */ | 1076 */ |
| 1068 List<UnlinkedParam> parameters; | 1077 List<UnlinkedParam> parameters; |
| 1069 | 1078 |
| 1070 /** | 1079 /** |
| 1071 * Kind of the parameter. | 1080 * Kind of the parameter. |
| 1072 */ | 1081 */ |
| 1073 UnlinkedParamKind kind; | 1082 UnlinkedParamKind kind; |
| 1074 | 1083 |
| 1075 /** | 1084 /** |
| 1076 * Indicates whether this is a function-typed parameter. | 1085 * Indicates whether this is a function-typed parameter. |
| 1077 */ | 1086 */ |
| 1078 bool isFunctionTyped; | 1087 bool isFunctionTyped; |
| 1079 | 1088 |
| 1080 /** | 1089 /** |
| 1081 * Indicates whether this is an initializing formal parameter (i.e. it is | 1090 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 1082 * declared using `this.` syntax). | 1091 * declared using `this.` syntax). |
| 1083 */ | 1092 */ |
| 1084 bool isInitializingFormal; | 1093 bool isInitializingFormal; |
| 1085 | |
| 1086 /** | |
| 1087 * Indicates whether this parameter lacks an explicit type declaration. | |
| 1088 * Always false for a function-typed parameter. | |
| 1089 */ | |
| 1090 bool hasImplicitType; | |
| 1091 } | 1094 } |
| 1092 | 1095 |
| 1093 /** | 1096 /** |
| 1094 * Enum used to indicate the kind of a parameter. | 1097 * Enum used to indicate the kind of a parameter. |
| 1095 */ | 1098 */ |
| 1096 enum UnlinkedParamKind { | 1099 enum UnlinkedParamKind { |
| 1097 /** | 1100 /** |
| 1098 * Parameter is required. | 1101 * Parameter is required. |
| 1099 */ | 1102 */ |
| 1100 required, | 1103 required, |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 int nameOffset; | 1376 int nameOffset; |
| 1374 | 1377 |
| 1375 /** | 1378 /** |
| 1376 * Documentation comment for the variable, or `null` if there is no | 1379 * Documentation comment for the variable, or `null` if there is no |
| 1377 * documentation comment. | 1380 * documentation comment. |
| 1378 */ | 1381 */ |
| 1379 @informative | 1382 @informative |
| 1380 UnlinkedDocumentationComment documentationComment; | 1383 UnlinkedDocumentationComment documentationComment; |
| 1381 | 1384 |
| 1382 /** | 1385 /** |
| 1383 * Declared type of the variable. Note that when strong mode is enabled, the | 1386 * Declared type of the variable. Absent if the type is implicit. |
| 1384 * actual type of the variable may be different due to type inference. | |
| 1385 */ | 1387 */ |
| 1386 EntityRef type; | 1388 EntityRef type; |
| 1387 | 1389 |
| 1388 /** | 1390 /** |
| 1389 * If [isConst] is true, and the variable has an initializer, the constant | 1391 * If [isConst] is true, and the variable has an initializer, the constant |
| 1390 * expression in the initializer. | 1392 * expression in the initializer. |
| 1391 */ | 1393 */ |
| 1392 UnlinkedConst constExpr; | 1394 UnlinkedConst constExpr; |
| 1393 | 1395 |
| 1394 /** | 1396 /** |
| 1395 * Indicates whether the variable is declared using the `static` keyword. | 1397 * Indicates whether the variable is declared using the `static` keyword. |
| 1396 * | 1398 * |
| 1397 * Note that for top level variables, this flag is false, since they are not | 1399 * Note that for top level variables, this flag is false, since they are not |
| 1398 * declared using the `static` keyword (even though they are considered | 1400 * declared using the `static` keyword (even though they are considered |
| 1399 * static for semantic purposes). | 1401 * static for semantic purposes). |
| 1400 */ | 1402 */ |
| 1401 bool isStatic; | 1403 bool isStatic; |
| 1402 | 1404 |
| 1403 /** | 1405 /** |
| 1404 * Indicates whether the variable is declared using the `final` keyword. | 1406 * Indicates whether the variable is declared using the `final` keyword. |
| 1405 */ | 1407 */ |
| 1406 bool isFinal; | 1408 bool isFinal; |
| 1407 | 1409 |
| 1408 /** | 1410 /** |
| 1409 * Indicates whether the variable is declared using the `const` keyword. | 1411 * Indicates whether the variable is declared using the `const` keyword. |
| 1410 */ | 1412 */ |
| 1411 bool isConst; | 1413 bool isConst; |
| 1412 | 1414 |
| 1413 /** | 1415 /** |
| 1414 * Indicates whether this variable lacks an explicit type declaration. | |
| 1415 */ | |
| 1416 bool hasImplicitType; | |
| 1417 | |
| 1418 /** | |
| 1419 * If this variable is propagable, nonzero slot id identifying which entry in | 1416 * If this variable is propagable, nonzero slot id identifying which entry in |
| 1420 * [LinkedLibrary.types] contains the propagated type for this variable. If | 1417 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 1421 * there is no matching entry in [LinkedLibrary.types], then this variable's | 1418 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 1422 * propagated type is the same as its declared type. | 1419 * propagated type is the same as its declared type. |
| 1423 * | 1420 * |
| 1424 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 1421 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 1425 */ | 1422 */ |
| 1426 int propagatedTypeSlot; | 1423 int propagatedTypeSlot; |
| 1427 } | 1424 } |
| OLD | NEW |