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

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

Issue 1120623003: Add a flag to the element model to identify mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 * is different from <i>has unimplemented members</i>. 171 * is different from <i>has unimplemented members</i>.
172 */ 172 */
173 bool get isAbstract; 173 bool get isAbstract;
174 174
175 /** 175 /**
176 * Return `true` if this class is defined by an enum declaration. 176 * Return `true` if this class is defined by an enum declaration.
177 */ 177 */
178 bool get isEnum; 178 bool get isEnum;
179 179
180 /** 180 /**
181 * Return `true` if this class is a mixin application. A class is a mixin
182 * application if it was declared using the syntax "class A = B with C;".
183 */
184 bool get isMixinApplication;
185
186 /**
181 * Return `true` if this class [isProxy], or if it inherits the proxy 187 * Return `true` if this class [isProxy], or if it inherits the proxy
182 * annotation from a supertype. 188 * annotation from a supertype.
183 */ 189 */
184 bool get isOrInheritsProxy; 190 bool get isOrInheritsProxy;
185 191
186 /** 192 /**
187 * Return `true` if this element has an annotation of the form '@proxy'. 193 * Return `true` if this element has an annotation of the form '@proxy'.
188 */ 194 */
189 bool get isProxy; 195 bool get isProxy;
190 196
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 return false; 659 return false;
654 } 660 }
655 661
656 @override 662 @override
657 bool get isAbstract => hasModifier(Modifier.ABSTRACT); 663 bool get isAbstract => hasModifier(Modifier.ABSTRACT);
658 664
659 @override 665 @override
660 bool get isEnum => hasModifier(Modifier.ENUM); 666 bool get isEnum => hasModifier(Modifier.ENUM);
661 667
662 @override 668 @override
669 bool get isMixinApplication => hasModifier(Modifier.MIXIN_APPLICATION);
670
671 @override
663 bool get isOrInheritsProxy => 672 bool get isOrInheritsProxy =>
664 _safeIsOrInheritsProxy(this, new HashSet<ClassElement>()); 673 _safeIsOrInheritsProxy(this, new HashSet<ClassElement>());
665 674
666 @override 675 @override
667 bool get isProxy { 676 bool get isProxy {
668 for (ElementAnnotation annotation in metadata) { 677 for (ElementAnnotation annotation in metadata) {
669 if (annotation.isProxy) { 678 if (annotation.isProxy) {
670 return true; 679 return true;
671 } 680 }
672 } 681 }
(...skipping 15 matching lines...) Expand all
688 /** 697 /**
689 * Set the methods contained in this class to the given [methods]. 698 * Set the methods contained in this class to the given [methods].
690 */ 699 */
691 void set methods(List<MethodElement> methods) { 700 void set methods(List<MethodElement> methods) {
692 for (MethodElement method in methods) { 701 for (MethodElement method in methods) {
693 (method as MethodElementImpl).enclosingElement = this; 702 (method as MethodElementImpl).enclosingElement = this;
694 } 703 }
695 this._methods = methods; 704 this._methods = methods;
696 } 705 }
697 706
707 /**
708 * Set whether this class is a mixin application.
709 */
710 void set mixinApplication(bool isMixinApplication) {
711 setModifier(Modifier.MIXIN_APPLICATION, isMixinApplication);
712 }
713
698 bool get mixinErrorsReported => hasModifier(Modifier.MIXIN_ERRORS_REPORTED); 714 bool get mixinErrorsReported => hasModifier(Modifier.MIXIN_ERRORS_REPORTED);
699 715
700 /** 716 /**
701 * Set whether an error has reported explaining why this class is an 717 * Set whether an error has reported explaining why this class is an
702 * invalid mixin application. 718 * invalid mixin application.
703 */ 719 */
704 void set mixinErrorsReported(bool value) { 720 void set mixinErrorsReported(bool value) {
705 setModifier(Modifier.MIXIN_ERRORS_REPORTED, value); 721 setModifier(Modifier.MIXIN_ERRORS_REPORTED, value);
706 } 722 }
707 723
(...skipping 7200 matching lines...) Expand 10 before | Expand all | Expand 10 after
7908 * scheme. 7924 * scheme.
7909 */ 7925 */
7910 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 9); 7926 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 9);
7911 7927
7912 /** 7928 /**
7913 * Indicates that a class can validly be used as a mixin. 7929 * Indicates that a class can validly be used as a mixin.
7914 */ 7930 */
7915 static const Modifier MIXIN = const Modifier('MIXIN', 10); 7931 static const Modifier MIXIN = const Modifier('MIXIN', 10);
7916 7932
7917 /** 7933 /**
7934 * Indicates that a class is a mixin application.
7935 */
7936 static const Modifier MIXIN_APPLICATION =
7937 const Modifier('MIXIN_APPLICATION', 11);
7938
7939 /**
7918 * Indicates that an error has reported explaining why this class is an 7940 * Indicates that an error has reported explaining why this class is an
7919 * invalid mixin application. 7941 * invalid mixin application.
7920 */ 7942 */
7921 static const Modifier MIXIN_ERRORS_REPORTED = 7943 static const Modifier MIXIN_ERRORS_REPORTED =
7922 const Modifier('MIXIN_ERRORS_REPORTED', 11); 7944 const Modifier('MIXIN_ERRORS_REPORTED', 12);
7923 7945
7924 /** 7946 /**
7925 * Indicates that the value of a parameter or local variable might be mutated 7947 * Indicates that the value of a parameter or local variable might be mutated
7926 * within the context. 7948 * within the context.
7927 */ 7949 */
7928 static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT = 7950 static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT =
7929 const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 12); 7951 const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 13);
7930 7952
7931 /** 7953 /**
7932 * Indicates that the value of a parameter or local variable might be mutated 7954 * Indicates that the value of a parameter or local variable might be mutated
7933 * within the scope. 7955 * within the scope.
7934 */ 7956 */
7935 static const Modifier POTENTIALLY_MUTATED_IN_SCOPE = 7957 static const Modifier POTENTIALLY_MUTATED_IN_SCOPE =
7936 const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 13); 7958 const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 14);
7937 7959
7938 /** 7960 /**
7939 * Indicates that a class contains an explicit reference to 'super'. 7961 * Indicates that a class contains an explicit reference to 'super'.
7940 */ 7962 */
7941 static const Modifier REFERENCES_SUPER = 7963 static const Modifier REFERENCES_SUPER =
7942 const Modifier('REFERENCES_SUPER', 14); 7964 const Modifier('REFERENCES_SUPER', 15);
7943 7965
7944 /** 7966 /**
7945 * Indicates that the pseudo-modifier 'set' was applied to the element. 7967 * Indicates that the pseudo-modifier 'set' was applied to the element.
7946 */ 7968 */
7947 static const Modifier SETTER = const Modifier('SETTER', 15); 7969 static const Modifier SETTER = const Modifier('SETTER', 16);
7948 7970
7949 /** 7971 /**
7950 * Indicates that the modifier 'static' was applied to the element. 7972 * Indicates that the modifier 'static' was applied to the element.
7951 */ 7973 */
7952 static const Modifier STATIC = const Modifier('STATIC', 16); 7974 static const Modifier STATIC = const Modifier('STATIC', 17);
7953 7975
7954 /** 7976 /**
7955 * Indicates that the element does not appear in the source code but was 7977 * Indicates that the element does not appear in the source code but was
7956 * implicitly created. For example, if a class does not define any 7978 * implicitly created. For example, if a class does not define any
7957 * constructors, an implicit zero-argument constructor will be created and it 7979 * constructors, an implicit zero-argument constructor will be created and it
7958 * will be marked as being synthetic. 7980 * will be marked as being synthetic.
7959 */ 7981 */
7960 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 17); 7982 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 18);
7961 7983
7962 /** 7984 /**
7963 * Indicates that a class was defined using an alias. 7985 * Indicates that a class was defined using an alias.
7964 * TODO(brianwilkerson) This should be renamed to 'ALIAS'. 7986 * TODO(brianwilkerson) This should be renamed to 'ALIAS'.
7965 */ 7987 */
7966 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 18); 7988 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 19);
7967 7989
7968 static const List<Modifier> values = const [ 7990 static const List<Modifier> values = const [
7969 ABSTRACT, 7991 ABSTRACT,
7970 ASYNCHRONOUS, 7992 ASYNCHRONOUS,
7971 CONST, 7993 CONST,
7972 DEFERRED, 7994 DEFERRED,
7973 ENUM, 7995 ENUM,
7974 FACTORY, 7996 FACTORY,
7975 FINAL, 7997 FINAL,
7976 GENERATOR, 7998 GENERATOR,
7977 GETTER, 7999 GETTER,
7978 HAS_EXT_URI, 8000 HAS_EXT_URI,
7979 MIXIN, 8001 MIXIN,
8002 MIXIN_APPLICATION,
7980 MIXIN_ERRORS_REPORTED, 8003 MIXIN_ERRORS_REPORTED,
7981 POTENTIALLY_MUTATED_IN_CONTEXT, 8004 POTENTIALLY_MUTATED_IN_CONTEXT,
7982 POTENTIALLY_MUTATED_IN_SCOPE, 8005 POTENTIALLY_MUTATED_IN_SCOPE,
7983 REFERENCES_SUPER, 8006 REFERENCES_SUPER,
7984 SETTER, 8007 SETTER,
7985 STATIC, 8008 STATIC,
7986 SYNTHETIC, 8009 SYNTHETIC,
7987 TYPEDEF 8010 TYPEDEF
7988 ]; 8011 ];
7989 8012
(...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after
10327 10350
10328 @override 10351 @override
10329 void visitElement(Element element) { 10352 void visitElement(Element element) {
10330 int offset = element.nameOffset; 10353 int offset = element.nameOffset;
10331 if (offset != -1) { 10354 if (offset != -1) {
10332 map[offset] = element; 10355 map[offset] = element;
10333 } 10356 }
10334 super.visitElement(element); 10357 super.visitElement(element);
10335 } 10358 }
10336 } 10359 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698