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

Side by Side Diff: pkg/analyzer/lib/dart/element/element.dart

Issue 2758123002: Create a new element for generic function types (Closed)
Patch Set: Created 3 years, 9 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 * Defines the element model. The element model describes the semantic (as 6 * Defines the element model. The element model describes the semantic (as
7 * opposed to syntactic) structure of Dart code. The syntactic structure of the 7 * opposed to syntactic) structure of Dart code. The syntactic structure of the
8 * code is modeled by the [AST structure](../ast/ast.dart). 8 * code is modeled by the [AST structure](../ast/ast.dart).
9 * 9 *
10 * The element model consists of two closely related kinds of objects: elements 10 * The element model consists of two closely related kinds of objects: elements
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 static const ElementKind ERROR = const ElementKind('ERROR', 4, "<error>"); 896 static const ElementKind ERROR = const ElementKind('ERROR', 4, "<error>");
897 897
898 static const ElementKind EXPORT = 898 static const ElementKind EXPORT =
899 const ElementKind('EXPORT', 5, "export directive"); 899 const ElementKind('EXPORT', 5, "export directive");
900 900
901 static const ElementKind FIELD = const ElementKind('FIELD', 6, "field"); 901 static const ElementKind FIELD = const ElementKind('FIELD', 6, "field");
902 902
903 static const ElementKind FUNCTION = 903 static const ElementKind FUNCTION =
904 const ElementKind('FUNCTION', 7, "function"); 904 const ElementKind('FUNCTION', 7, "function");
905 905
906 static const ElementKind GETTER = const ElementKind('GETTER', 8, "getter"); 906 static const ElementKind GENERIC_FUNCTION_TYPE = const ElementKind('GENERIC_FU NCTION_TYPE', 8, 'generic function type');
907
908 static const ElementKind GETTER = const ElementKind('GETTER', 9, "getter");
907 909
908 static const ElementKind IMPORT = 910 static const ElementKind IMPORT =
909 const ElementKind('IMPORT', 9, "import directive"); 911 const ElementKind('IMPORT', 10, "import directive");
910 912
911 static const ElementKind LABEL = const ElementKind('LABEL', 10, "label"); 913 static const ElementKind LABEL = const ElementKind('LABEL', 11, "label");
912 914
913 static const ElementKind LIBRARY = 915 static const ElementKind LIBRARY =
914 const ElementKind('LIBRARY', 11, "library"); 916 const ElementKind('LIBRARY', 12, "library");
915 917
916 static const ElementKind LOCAL_VARIABLE = 918 static const ElementKind LOCAL_VARIABLE =
917 const ElementKind('LOCAL_VARIABLE', 12, "local variable"); 919 const ElementKind('LOCAL_VARIABLE', 13, "local variable");
918 920
919 static const ElementKind METHOD = const ElementKind('METHOD', 13, "method"); 921 static const ElementKind METHOD = const ElementKind('METHOD', 14, "method");
920 922
921 static const ElementKind NAME = const ElementKind('NAME', 14, "<name>"); 923 static const ElementKind NAME = const ElementKind('NAME', 15, "<name>");
922 924
923 static const ElementKind PARAMETER = 925 static const ElementKind PARAMETER =
924 const ElementKind('PARAMETER', 15, "parameter"); 926 const ElementKind('PARAMETER', 16, "parameter");
925 927
926 static const ElementKind PREFIX = 928 static const ElementKind PREFIX =
927 const ElementKind('PREFIX', 16, "import prefix"); 929 const ElementKind('PREFIX', 17, "import prefix");
928 930
929 static const ElementKind SETTER = const ElementKind('SETTER', 17, "setter"); 931 static const ElementKind SETTER = const ElementKind('SETTER', 18, "setter");
930 932
931 static const ElementKind TOP_LEVEL_VARIABLE = 933 static const ElementKind TOP_LEVEL_VARIABLE =
932 const ElementKind('TOP_LEVEL_VARIABLE', 18, "top level variable"); 934 const ElementKind('TOP_LEVEL_VARIABLE', 19, "top level variable");
933 935
934 static const ElementKind FUNCTION_TYPE_ALIAS = 936 static const ElementKind FUNCTION_TYPE_ALIAS =
935 const ElementKind('FUNCTION_TYPE_ALIAS', 19, "function type alias"); 937 const ElementKind('FUNCTION_TYPE_ALIAS', 20, "function type alias");
936 938
937 static const ElementKind TYPE_PARAMETER = 939 static const ElementKind TYPE_PARAMETER =
938 const ElementKind('TYPE_PARAMETER', 20, "type parameter"); 940 const ElementKind('TYPE_PARAMETER', 21, "type parameter");
939 941
940 static const ElementKind UNIVERSE = 942 static const ElementKind UNIVERSE =
941 const ElementKind('UNIVERSE', 21, "<universe>"); 943 const ElementKind('UNIVERSE', 22, "<universe>");
942 944
943 static const List<ElementKind> values = const [ 945 static const List<ElementKind> values = const [
944 CLASS, 946 CLASS,
945 COMPILATION_UNIT, 947 COMPILATION_UNIT,
946 CONSTRUCTOR, 948 CONSTRUCTOR,
947 DYNAMIC, 949 DYNAMIC,
948 ERROR, 950 ERROR,
949 EXPORT, 951 EXPORT,
950 FIELD, 952 FIELD,
951 FUNCTION, 953 FUNCTION,
954 GENERIC_FUNCTION_TYPE,
952 GETTER, 955 GETTER,
953 IMPORT, 956 IMPORT,
954 LABEL, 957 LABEL,
955 LIBRARY, 958 LIBRARY,
956 LOCAL_VARIABLE, 959 LOCAL_VARIABLE,
957 METHOD, 960 METHOD,
958 NAME, 961 NAME,
959 PARAMETER, 962 PARAMETER,
960 PREFIX, 963 PREFIX,
961 SETTER, 964 SETTER,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 R visitExportElement(ExportElement element); 1051 R visitExportElement(ExportElement element);
1049 1052
1050 R visitFieldElement(FieldElement element); 1053 R visitFieldElement(FieldElement element);
1051 1054
1052 R visitFieldFormalParameterElement(FieldFormalParameterElement element); 1055 R visitFieldFormalParameterElement(FieldFormalParameterElement element);
1053 1056
1054 R visitFunctionElement(FunctionElement element); 1057 R visitFunctionElement(FunctionElement element);
1055 1058
1056 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element); 1059 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
1057 1060
1061 R visitGenericFunctionTypeElement(GenericFunctionTypeElement element);
1062
1058 R visitImportElement(ImportElement element); 1063 R visitImportElement(ImportElement element);
1059 1064
1060 R visitLabelElement(LabelElement element); 1065 R visitLabelElement(LabelElement element);
1061 1066
1062 R visitLibraryElement(LibraryElement element); 1067 R visitLibraryElement(LibraryElement element);
1063 1068
1064 R visitLocalVariableElement(LocalVariableElement element); 1069 R visitLocalVariableElement(LocalVariableElement element);
1065 1070
1066 R visitMethodElement(MethodElement element); 1071 R visitMethodElement(MethodElement element);
1067 1072
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 * Return `true` if the function is an entry point, i.e. a top-level function 1269 * Return `true` if the function is an entry point, i.e. a top-level function
1265 * and has the name `main`. 1270 * and has the name `main`.
1266 */ 1271 */
1267 bool get isEntryPoint; 1272 bool get isEntryPoint;
1268 1273
1269 @override 1274 @override
1270 FunctionDeclaration computeNode(); 1275 FunctionDeclaration computeNode();
1271 } 1276 }
1272 1277
1273 /** 1278 /**
1279 * The pseudo-declaration that defines a generic function type.
1280 */
1281 abstract class GenericFunctionTypeElement implements FunctionTypedElement {
1282
1283 }
1284
1285 /**
1274 * A function type alias (`typedef`). 1286 * A function type alias (`typedef`).
1275 * 1287 *
1276 * Clients may not extend, implement or mix-in this class. 1288 * Clients may not extend, implement or mix-in this class.
1277 */ 1289 */
1278 abstract class FunctionTypeAliasElement 1290 abstract class FunctionTypeAliasElement
1279 implements FunctionTypedElement, TypeDefiningElement { 1291 implements FunctionTypedElement, TypeDefiningElement {
1280 /** 1292 /**
1281 * An empty array of type alias elements. 1293 * An empty array of type alias elements.
1282 */ 1294 */
1283 static List<FunctionTypeAliasElement> EMPTY_LIST = 1295 static List<FunctionTypeAliasElement> EMPTY_LIST =
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 DartType get type; 2064 DartType get type;
2053 2065
2054 /** 2066 /**
2055 * Return a representation of the value of this variable, forcing the value 2067 * Return a representation of the value of this variable, forcing the value
2056 * to be computed if it had not previously been computed, or `null` if either 2068 * to be computed if it had not previously been computed, or `null` if either
2057 * this variable was not declared with the 'const' modifier or if the value of 2069 * this variable was not declared with the 'const' modifier or if the value of
2058 * this variable could not be computed because of errors. 2070 * this variable could not be computed because of errors.
2059 */ 2071 */
2060 DartObject computeConstantValue(); 2072 DartObject computeConstantValue();
2061 } 2073 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/protocol_server_test.dart ('k') | pkg/analyzer/lib/dart/element/visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698