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

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

Issue 1678753002: Summarize constructor initializers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 * and push it onto the stack. 607 * and push it onto the stack.
608 */ 608 */
609 makeSymbol, 609 makeSymbol,
610 610
611 /** 611 /**
612 * Push the constant `null` onto the stack. 612 * Push the constant `null` onto the stack.
613 */ 613 */
614 pushNull, 614 pushNull,
615 615
616 /** 616 /**
617 * Push the value of the constant constructor parameter with
618 * the name obtained from [UnlinkedConst.strings].
619 */
620 pushConstructorParameter,
621
622 /**
617 * Evaluate a (potentially qualified) identifier expression and push the 623 * Evaluate a (potentially qualified) identifier expression and push the
618 * resulting value onto the stack. The identifier to be evaluated is 624 * resulting value onto the stack. The identifier to be evaluated is
619 * obtained from [UnlinkedConst.references]. 625 * obtained from [UnlinkedConst.references].
620 * 626 *
621 * This operation is used to represent the following kinds of constants 627 * This operation is used to represent the following kinds of constants
622 * (which are indistinguishable from an unresolved AST alone): 628 * (which are indistinguishable from an unresolved AST alone):
623 * 629 *
624 * - A qualified reference to a static constant variable (e.g. `C.v`, where 630 * - A qualified reference to a static constant variable (e.g. `C.v`, where
625 * C is a class and `v` is a constant static variable in `C`). 631 * C is a class and `v` is a constant static variable in `C`).
626 * - An identifier expression referring to a constant variable. 632 * - An identifier expression referring to a constant variable.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 conditional, 832 conditional,
827 833
828 /** 834 /**
829 * Pop the top value from the stack, evaluate `v.length`, and push the result 835 * Pop the top value from the stack, evaluate `v.length`, and push the result
830 * back onto the stack. 836 * back onto the stack.
831 */ 837 */
832 length, 838 length,
833 } 839 }
834 840
835 /** 841 /**
842 * Unlinked summary information about a constructor initializer.
843 */
844 abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
845 /**
846 * The kind of the constructor initializer (field, redirect, super).
847 */
848 UnlinkedConstructorInitializerKind get kind;
849
850 /**
851 * Depending on the [kind] is the name of the field declared in the class,
Paul Berry 2016/02/08 14:53:12 Rather than make the reader figure out which possi
scheglov 2016/02/08 16:29:51 Done.
852 * or the name of the constructor to redirect to (may be `null`), or the name
853 * of the invoked super constructor (may be `null`).
854 */
855 String get name;
856
857 /**
858 * If [UnlinkedConstructorInitializerKind.field], the expression of the
Paul Berry 2016/02/08 14:53:12 Nit: how about saying "If [kind] is `field`"? It'
scheglov 2016/02/08 16:29:51 Done.
859 * field initializer. Otherwise `null`.
860 */
861 UnlinkedConst get expression;
862
863 /**
864 * If [UnlinkedConstructorInitializerKind.thisInvocation] or
865 * [UnlinkedConstructorInitializerKind.superInvocation], the arguments of
866 * the invocation. Otherwise empty.
867 */
868 List<UnlinkedConst> get arguments;
869 }
870
871 /**
872 * Enum used to indicate the kind of an constructor initializer.
873 */
874 enum UnlinkedConstructorInitializerKind {
875 /**
876 * Initialization of a field.
877 */
878 field,
879
880 /**
881 * Invocation of a constructor in the same class.
882 */
883 thisInvocation,
884
885 /**
886 * Invocation of a superclass' constructor.
887 */
888 superInvocation
889 }
890
891 /**
836 * Unlinked summary information about a documentation comment. 892 * Unlinked summary information about a documentation comment.
837 */ 893 */
838 abstract class UnlinkedDocumentationComment extends base.SummaryClass { 894 abstract class UnlinkedDocumentationComment extends base.SummaryClass {
839 /** 895 /**
840 * Text of the documentation comment, with '\r\n' replaced by '\n'. 896 * Text of the documentation comment, with '\r\n' replaced by '\n'.
841 * 897 *
842 * References appearing within the doc comment in square brackets are not 898 * References appearing within the doc comment in square brackets are not
843 * specially encoded. 899 * specially encoded.
844 */ 900 */
845 String get text; 901 String get text;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 */ 1041 */
986 bool get isFactory; 1042 bool get isFactory;
987 1043
988 /** 1044 /**
989 * Indicates whether the executable is declared using the `external` keyword. 1045 * Indicates whether the executable is declared using the `external` keyword.
990 */ 1046 */
991 bool get isExternal; 1047 bool get isExternal;
992 1048
993 /** 1049 /**
994 * If this executable's return type is inferable, nonzero slot id 1050 * If this executable's return type is inferable, nonzero slot id
995 * identifying which entry in [LinkedLibrary.types] contains the inferred 1051 * identifying which entry in [LinkedUnit.types] contains the inferred
996 * return type. If there is no matching entry in [LinkedLibrary.types], then 1052 * return type. If there is no matching entry in [LinkedUnit.types], then
997 * no return type was inferred for this variable, so its static type is 1053 * no return type was inferred for this variable, so its static type is
998 * `dynamic`. 1054 * `dynamic`.
999 */ 1055 */
1000 int get inferredReturnTypeSlot; 1056 int get inferredReturnTypeSlot;
1057
1058 /**
1059 * If a constant [UnlinkedExecutableKind.constructor], the constructor
1060 * initializers. Otherwise empty.
1061 */
1062 List<UnlinkedConstructorInitializer> get constantInitializers;
1001 } 1063 }
1002 1064
1003 /** 1065 /**
1004 * Enum used to indicate the kind of an executable. 1066 * Enum used to indicate the kind of an executable.
1005 */ 1067 */
1006 enum UnlinkedExecutableKind { 1068 enum UnlinkedExecutableKind {
1007 /** 1069 /**
1008 * Executable is a function or method. 1070 * Executable is a function or method.
1009 */ 1071 */
1010 functionOrMethod, 1072 functionOrMethod,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 int get propagatedTypeSlot; 1590 int get propagatedTypeSlot;
1529 1591
1530 /** 1592 /**
1531 * If this variable is inferable, nonzero slot id identifying which entry in 1593 * If this variable is inferable, nonzero slot id identifying which entry in
1532 * [LinkedLibrary.types] contains the inferred type for this variable. If 1594 * [LinkedLibrary.types] contains the inferred type for this variable. If
1533 * there is no matching entry in [LinkedLibrary.types], then no type was 1595 * there is no matching entry in [LinkedLibrary.types], then no type was
1534 * inferred for this variable, so its static type is `dynamic`. 1596 * inferred for this variable, so its static type is `dynamic`.
1535 */ 1597 */
1536 int get inferredTypeSlot; 1598 int get inferredTypeSlot;
1537 } 1599 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698