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

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: Updates for review comments. 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 * and push it onto the stack. 612 * and push it onto the stack.
613 */ 613 */
614 makeSymbol, 614 makeSymbol,
615 615
616 /** 616 /**
617 * Push the constant `null` onto the stack. 617 * Push the constant `null` onto the stack.
618 */ 618 */
619 pushNull, 619 pushNull,
620 620
621 /** 621 /**
622 * Push the value of the constant constructor parameter with
623 * the name obtained from [UnlinkedConst.strings].
624 */
625 pushConstructorParameter,
626
627 /**
622 * Evaluate a (potentially qualified) identifier expression and push the 628 * Evaluate a (potentially qualified) identifier expression and push the
623 * resulting value onto the stack. The identifier to be evaluated is 629 * resulting value onto the stack. The identifier to be evaluated is
624 * obtained from [UnlinkedConst.references]. 630 * obtained from [UnlinkedConst.references].
625 * 631 *
626 * This operation is used to represent the following kinds of constants 632 * This operation is used to represent the following kinds of constants
627 * (which are indistinguishable from an unresolved AST alone): 633 * (which are indistinguishable from an unresolved AST alone):
628 * 634 *
629 * - A qualified reference to a static constant variable (e.g. `C.v`, where 635 * - A qualified reference to a static constant variable (e.g. `C.v`, where
630 * C is a class and `v` is a constant static variable in `C`). 636 * C is a class and `v` is a constant static variable in `C`).
631 * - An identifier expression referring to a constant variable. 637 * - An identifier expression referring to a constant variable.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 conditional, 837 conditional,
832 838
833 /** 839 /**
834 * Pop the top value from the stack, evaluate `v.length`, and push the result 840 * Pop the top value from the stack, evaluate `v.length`, and push the result
835 * back onto the stack. 841 * back onto the stack.
836 */ 842 */
837 length, 843 length,
838 } 844 }
839 845
840 /** 846 /**
847 * Unlinked summary information about a constructor initializer.
848 */
849 abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
850 /**
851 * The kind of the constructor initializer (field, redirect, super).
852 */
853 UnlinkedConstructorInitializerKind get kind;
854
855 /**
856 * If [kind] is `field`, the name of the field declared in the class. If
857 * [kind] is `thisInvocation`, the name of the constructor, declared in this
858 * class, to redirect to. If [kind] is `superInvocation`, the name of the
859 * constructor, declared in the superclass, to invoke.
860 */
861 String get name;
862
863 /**
864 * If [kind] is `field`, the expression of the field initializer.
865 * Otherwise `null`.
866 */
867 UnlinkedConst get expression;
868
869 /**
870 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
871 * invocation. Otherwise empty.
872 */
873 List<UnlinkedConst> get arguments;
874 }
875
876 /**
877 * Enum used to indicate the kind of an constructor initializer.
878 */
879 enum UnlinkedConstructorInitializerKind {
880 /**
881 * Initialization of a field.
882 */
883 field,
884
885 /**
886 * Invocation of a constructor in the same class.
887 */
888 thisInvocation,
889
890 /**
891 * Invocation of a superclass' constructor.
892 */
893 superInvocation
894 }
895
896 /**
841 * Unlinked summary information about a documentation comment. 897 * Unlinked summary information about a documentation comment.
842 */ 898 */
843 abstract class UnlinkedDocumentationComment extends base.SummaryClass { 899 abstract class UnlinkedDocumentationComment extends base.SummaryClass {
844 /** 900 /**
845 * Text of the documentation comment, with '\r\n' replaced by '\n'. 901 * Text of the documentation comment, with '\r\n' replaced by '\n'.
846 * 902 *
847 * References appearing within the doc comment in square brackets are not 903 * References appearing within the doc comment in square brackets are not
848 * specially encoded. 904 * specially encoded.
849 */ 905 */
850 String get text; 906 String get text;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 */ 1056 */
1001 bool get isFactory; 1057 bool get isFactory;
1002 1058
1003 /** 1059 /**
1004 * Indicates whether the executable is declared using the `external` keyword. 1060 * Indicates whether the executable is declared using the `external` keyword.
1005 */ 1061 */
1006 bool get isExternal; 1062 bool get isExternal;
1007 1063
1008 /** 1064 /**
1009 * If this executable's return type is inferable, nonzero slot id 1065 * If this executable's return type is inferable, nonzero slot id
1010 * identifying which entry in [LinkedLibrary.types] contains the inferred 1066 * identifying which entry in [LinkedUnit.types] contains the inferred
1011 * return type. If there is no matching entry in [LinkedLibrary.types], then 1067 * return type. If there is no matching entry in [LinkedUnit.types], then
1012 * no return type was inferred for this variable, so its static type is 1068 * no return type was inferred for this variable, so its static type is
1013 * `dynamic`. 1069 * `dynamic`.
1014 */ 1070 */
1015 int get inferredReturnTypeSlot; 1071 int get inferredReturnTypeSlot;
1072
1073 /**
1074 * If a constant [UnlinkedExecutableKind.constructor], the constructor
1075 * initializers. Otherwise empty.
1076 */
1077 List<UnlinkedConstructorInitializer> get constantInitializers;
1016 } 1078 }
1017 1079
1018 /** 1080 /**
1019 * Enum used to indicate the kind of an executable. 1081 * Enum used to indicate the kind of an executable.
1020 */ 1082 */
1021 enum UnlinkedExecutableKind { 1083 enum UnlinkedExecutableKind {
1022 /** 1084 /**
1023 * Executable is a function or method. 1085 * Executable is a function or method.
1024 */ 1086 */
1025 functionOrMethod, 1087 functionOrMethod,
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 int get propagatedTypeSlot; 1646 int get propagatedTypeSlot;
1585 1647
1586 /** 1648 /**
1587 * If this variable is inferable, nonzero slot id identifying which entry in 1649 * If this variable is inferable, nonzero slot id identifying which entry in
1588 * [LinkedLibrary.types] contains the inferred type for this variable. If 1650 * [LinkedLibrary.types] contains the inferred type for this variable. If
1589 * there is no matching entry in [LinkedLibrary.types], then no type was 1651 * there is no matching entry in [LinkedLibrary.types], then no type was
1590 * inferred for this variable, so its static type is `dynamic`. 1652 * inferred for this variable, so its static type is `dynamic`.
1591 */ 1653 */
1592 int get inferredTypeSlot; 1654 int get inferredTypeSlot;
1593 } 1655 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698