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

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

Issue 214593008: Rollback pkg/analyzer that breaks code_transformers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 * @return `true` if this annotation marks the associated class as implementin g a proxy 724 * @return `true` if this annotation marks the associated class as implementin g a proxy
725 * object 725 * object
726 */ 726 */
727 bool get isProxy; 727 bool get isProxy;
728 } 728 }
729 729
730 /** 730 /**
731 * The enumeration `ElementKind` defines the various kinds of elements in the el ement model. 731 * The enumeration `ElementKind` defines the various kinds of elements in the el ement model.
732 */ 732 */
733 class ElementKind extends Enum<ElementKind> { 733 class ElementKind extends Enum<ElementKind> {
734 static const ElementKind ANGULAR_FILTER = const ElementKind('ANGULAR_FILTER', 0, "Angular filter"); 734 static final ElementKind ANGULAR_FILTER = new ElementKind('ANGULAR_FILTER', 0, "Angular filter");
735 735
736 static const ElementKind ANGULAR_COMPONENT = const ElementKind('ANGULAR_COMPON ENT', 1, "Angular component"); 736 static final ElementKind ANGULAR_COMPONENT = new ElementKind('ANGULAR_COMPONEN T', 1, "Angular component");
737 737
738 static const ElementKind ANGULAR_CONTROLLER = const ElementKind('ANGULAR_CONTR OLLER', 2, "Angular controller"); 738 static final ElementKind ANGULAR_CONTROLLER = new ElementKind('ANGULAR_CONTROL LER', 2, "Angular controller");
739 739
740 static const ElementKind ANGULAR_DIRECTIVE = const ElementKind('ANGULAR_DIRECT IVE', 3, "Angular directive"); 740 static final ElementKind ANGULAR_DIRECTIVE = new ElementKind('ANGULAR_DIRECTIV E', 3, "Angular directive");
741 741
742 static const ElementKind ANGULAR_PROPERTY = const ElementKind('ANGULAR_PROPERT Y', 4, "Angular property"); 742 static final ElementKind ANGULAR_PROPERTY = new ElementKind('ANGULAR_PROPERTY' , 4, "Angular property");
743 743
744 static const ElementKind ANGULAR_SCOPE_PROPERTY = const ElementKind('ANGULAR_S COPE_PROPERTY', 5, "Angular scope property"); 744 static final ElementKind ANGULAR_SCOPE_PROPERTY = new ElementKind('ANGULAR_SCO PE_PROPERTY', 5, "Angular scope property");
745 745
746 static const ElementKind ANGULAR_SELECTOR = const ElementKind('ANGULAR_SELECTO R', 6, "Angular selector"); 746 static final ElementKind ANGULAR_SELECTOR = new ElementKind('ANGULAR_SELECTOR' , 6, "Angular selector");
747 747
748 static const ElementKind ANGULAR_VIEW = const ElementKind('ANGULAR_VIEW', 7, " Angular view"); 748 static final ElementKind ANGULAR_VIEW = new ElementKind('ANGULAR_VIEW', 7, "An gular view");
749 749
750 static const ElementKind CLASS = const ElementKind('CLASS', 8, "class"); 750 static final ElementKind CLASS = new ElementKind('CLASS', 8, "class");
751 751
752 static const ElementKind COMPILATION_UNIT = const ElementKind('COMPILATION_UNI T', 9, "compilation unit"); 752 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT' , 9, "compilation unit");
753 753
754 static const ElementKind CONSTRUCTOR = const ElementKind('CONSTRUCTOR', 10, "c onstructor"); 754 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 10, "con structor");
755 755
756 static const ElementKind DYNAMIC = const ElementKind('DYNAMIC', 11, "<dynamic> "); 756 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 11, "<dynamic>") ;
757 757
758 static const ElementKind EMBEDDED_HTML_SCRIPT = const ElementKind('EMBEDDED_HT ML_SCRIPT', 12, "embedded html script"); 758 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML _SCRIPT', 12, "embedded html script");
759 759
760 static const ElementKind ERROR = const ElementKind('ERROR', 13, "<error>"); 760 static final ElementKind ERROR = new ElementKind('ERROR', 13, "<error>");
761 761
762 static const ElementKind EXPORT = const ElementKind('EXPORT', 14, "export dire ctive"); 762 static final ElementKind EXPORT = new ElementKind('EXPORT', 14, "export direct ive");
763 763
764 static const ElementKind EXTERNAL_HTML_SCRIPT = const ElementKind('EXTERNAL_HT ML_SCRIPT', 15, "external html script"); 764 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML _SCRIPT', 15, "external html script");
765 765
766 static const ElementKind FIELD = const ElementKind('FIELD', 16, "field"); 766 static final ElementKind FIELD = new ElementKind('FIELD', 16, "field");
767 767
768 static const ElementKind FUNCTION = const ElementKind('FUNCTION', 17, "functio n"); 768 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 17, "function" );
769 769
770 static const ElementKind GETTER = const ElementKind('GETTER', 18, "getter"); 770 static final ElementKind GETTER = new ElementKind('GETTER', 18, "getter");
771 771
772 static const ElementKind HTML = const ElementKind('HTML', 19, "html"); 772 static final ElementKind HTML = new ElementKind('HTML', 19, "html");
773 773
774 static const ElementKind IMPORT = const ElementKind('IMPORT', 20, "import dire ctive"); 774 static final ElementKind IMPORT = new ElementKind('IMPORT', 20, "import direct ive");
775 775
776 static const ElementKind LABEL = const ElementKind('LABEL', 21, "label"); 776 static final ElementKind LABEL = new ElementKind('LABEL', 21, "label");
777 777
778 static const ElementKind LIBRARY = const ElementKind('LIBRARY', 22, "library") ; 778 static final ElementKind LIBRARY = new ElementKind('LIBRARY', 22, "library");
779 779
780 static const ElementKind LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE', 23, "local variable"); 780 static final ElementKind LOCAL_VARIABLE = new ElementKind('LOCAL_VARIABLE', 23 , "local variable");
781 781
782 static const ElementKind METHOD = const ElementKind('METHOD', 24, "method"); 782 static final ElementKind METHOD = new ElementKind('METHOD', 24, "method");
783 783
784 static const ElementKind NAME = const ElementKind('NAME', 25, "<name>"); 784 static final ElementKind NAME = new ElementKind('NAME', 25, "<name>");
785 785
786 static const ElementKind PARAMETER = const ElementKind('PARAMETER', 26, "param eter"); 786 static final ElementKind PARAMETER = new ElementKind('PARAMETER', 26, "paramet er");
787 787
788 static const ElementKind PREFIX = const ElementKind('PREFIX', 27, "import pref ix"); 788 static final ElementKind PREFIX = new ElementKind('PREFIX', 27, "import prefix ");
789 789
790 static const ElementKind SETTER = const ElementKind('SETTER', 28, "setter"); 790 static final ElementKind SETTER = new ElementKind('SETTER', 28, "setter");
791 791
792 static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VAR IABLE', 29, "top level variable"); 792 static final ElementKind TOP_LEVEL_VARIABLE = new ElementKind('TOP_LEVEL_VARIA BLE', 29, "top level variable");
793 793
794 static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYP E_ALIAS', 30, "function type alias"); 794 static final ElementKind FUNCTION_TYPE_ALIAS = new ElementKind('FUNCTION_TYPE_ ALIAS', 30, "function type alias");
795 795
796 static const ElementKind TYPE_PARAMETER = const ElementKind('TYPE_PARAMETER', 31, "type parameter"); 796 static final ElementKind TYPE_PARAMETER = new ElementKind('TYPE_PARAMETER', 31 , "type parameter");
797 797
798 static const ElementKind UNIVERSE = const ElementKind('UNIVERSE', 32, "<univer se>"); 798 static final ElementKind UNIVERSE = new ElementKind('UNIVERSE', 32, "<universe >");
799 799
800 static const List<ElementKind> values = const [ 800 static final List<ElementKind> values = [
801 ANGULAR_FILTER, 801 ANGULAR_FILTER,
802 ANGULAR_COMPONENT, 802 ANGULAR_COMPONENT,
803 ANGULAR_CONTROLLER, 803 ANGULAR_CONTROLLER,
804 ANGULAR_DIRECTIVE, 804 ANGULAR_DIRECTIVE,
805 ANGULAR_PROPERTY, 805 ANGULAR_PROPERTY,
806 ANGULAR_SCOPE_PROPERTY, 806 ANGULAR_SCOPE_PROPERTY,
807 ANGULAR_SELECTOR, 807 ANGULAR_SELECTOR,
808 ANGULAR_VIEW, 808 ANGULAR_VIEW,
809 CLASS, 809 CLASS,
810 COMPILATION_UNIT, 810 COMPILATION_UNIT,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 static ElementKind of(Element element) { 842 static ElementKind of(Element element) {
843 if (element == null) { 843 if (element == null) {
844 return ERROR; 844 return ERROR;
845 } 845 }
846 return element.kind; 846 return element.kind;
847 } 847 }
848 848
849 /** 849 /**
850 * The name displayed in the UI for this kind of element. 850 * The name displayed in the UI for this kind of element.
851 */ 851 */
852 final String displayName; 852 String displayName;
853 853
854 /** 854 /**
855 * Initialize a newly created element kind to have the given display name. 855 * Initialize a newly created element kind to have the given display name.
856 * 856 *
857 * @param displayName the name displayed in the UI for this kind of element 857 * @param displayName the name displayed in the UI for this kind of element
858 */ 858 */
859 const ElementKind(String name, int ordinal, this.displayName) : super(name, or dinal); 859 ElementKind(String name, int ordinal, String displayName) : super(name, ordina l) {
860 this.displayName = displayName;
861 }
860 } 862 }
861 863
862 /** 864 /**
863 * The interface `ElementLocation` defines the behavior of objects that represen t the location 865 * The interface `ElementLocation` defines the behavior of objects that represen t the location
864 * of an element within the element model. 866 * of an element within the element model.
865 */ 867 */
866 abstract class ElementLocation { 868 abstract class ElementLocation {
867 /** 869 /**
868 * Return an encoded representation of this location that can be used to creat e a location that is 870 * Return an encoded representation of this location that can be used to creat e a location that is
869 * equal to this location. 871 * equal to this location.
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 1980
1979 /** 1981 /**
1980 * The enumeration `AngularPropertyKind` defines the different kinds of property bindings. 1982 * The enumeration `AngularPropertyKind` defines the different kinds of property bindings.
1981 */ 1983 */
1982 class AngularPropertyKind extends Enum<AngularPropertyKind> { 1984 class AngularPropertyKind extends Enum<AngularPropertyKind> {
1983 /** 1985 /**
1984 * `@` - Map the DOM attribute string. The attribute string will be taken lite rally or 1986 * `@` - Map the DOM attribute string. The attribute string will be taken lite rally or
1985 * interpolated if it contains binding {{}} syntax and assigned to the express ion. (cost: 0 1987 * interpolated if it contains binding {{}} syntax and assigned to the express ion. (cost: 0
1986 * watches) 1988 * watches)
1987 */ 1989 */
1988 static const AngularPropertyKind ATTR = const AngularPropertyKind('ATTR', 0); 1990 static final AngularPropertyKind ATTR = new AngularPropertyKind('ATTR', 0);
1989 1991
1990 /** 1992 /**
1991 * `&` - Treat the DOM attribute value as an expression. Assign a closure func tion into the field. 1993 * `&` - Treat the DOM attribute value as an expression. Assign a closure func tion into the field.
1992 * This allows the component to control the invocation of the closure. This is useful for passing 1994 * This allows the component to control the invocation of the closure. This is useful for passing
1993 * expressions into controllers which act like callbacks. (cost: 0 watches) 1995 * expressions into controllers which act like callbacks. (cost: 0 watches)
1994 */ 1996 */
1995 static const AngularPropertyKind CALLBACK = const AngularPropertyKind('CALLBAC K', 1); 1997 static final AngularPropertyKind CALLBACK = new AngularPropertyKind('CALLBACK' , 1);
1996 1998
1997 /** 1999 /**
1998 * `=>` - Treat the DOM attribute value as an expression. Set up a watch, whic h will read the 2000 * `=>` - Treat the DOM attribute value as an expression. Set up a watch, whic h will read the
1999 * expression in the attribute and assign the value to destination expression. (cost: 1 watch) 2001 * expression in the attribute and assign the value to destination expression. (cost: 1 watch)
2000 */ 2002 */
2001 static const AngularPropertyKind ONE_WAY = const AngularPropertyKind('ONE_WAY' , 2); 2003 static final AngularPropertyKind ONE_WAY = new AngularPropertyKind('ONE_WAY', 2);
2002 2004
2003 /** 2005 /**
2004 * `=>!` - Treat the DOM attribute value as an expression. Set up a one time w atch on expression. 2006 * `=>!` - Treat the DOM attribute value as an expression. Set up a one time w atch on expression.
2005 * Once the expression turns not null it will no longer update. (cost: 1 watch es until not null, 2007 * Once the expression turns not null it will no longer update. (cost: 1 watch es until not null,
2006 * then 0 watches) 2008 * then 0 watches)
2007 */ 2009 */
2008 static const AngularPropertyKind ONE_WAY_ONE_TIME = const AngularPropertyKind( 'ONE_WAY_ONE_TIME', 3); 2010 static final AngularPropertyKind ONE_WAY_ONE_TIME = new AngularPropertyKind('O NE_WAY_ONE_TIME', 3);
2009 2011
2010 /** 2012 /**
2011 * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on b oth outside as well 2013 * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on b oth outside as well
2012 * as component scope to keep the source and destination in sync. (cost: 2 wat ches) 2014 * as component scope to keep the source and destination in sync. (cost: 2 wat ches)
2013 */ 2015 */
2014 static const AngularPropertyKind TWO_WAY = const AngularPropertyKind_TWO_WAY(' TWO_WAY', 4); 2016 static final AngularPropertyKind TWO_WAY = new AngularPropertyKind_TWO_WAY('TW O_WAY', 4);
2015 2017
2016 static const List<AngularPropertyKind> values = const [ATTR, CALLBACK, ONE_WAY , ONE_WAY_ONE_TIME, TWO_WAY]; 2018 static final List<AngularPropertyKind> values = [ATTR, CALLBACK, ONE_WAY, ONE_ WAY_ONE_TIME, TWO_WAY];
2017 2019
2018 /** 2020 /**
2019 * Returns `true` if property of this kind calls field getter. 2021 * Returns `true` if property of this kind calls field getter.
2020 */ 2022 */
2021 bool callsGetter() => false; 2023 bool callsGetter() => false;
2022 2024
2023 /** 2025 /**
2024 * Returns `true` if property of this kind calls field setter. 2026 * Returns `true` if property of this kind calls field setter.
2025 */ 2027 */
2026 bool callsSetter() => true; 2028 bool callsSetter() => true;
2027 2029
2028 const AngularPropertyKind(String name, int ordinal) : super(name, ordinal); 2030 AngularPropertyKind(String name, int ordinal) : super(name, ordinal);
2029 } 2031 }
2030 2032
2031 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind { 2033 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind {
2032 const AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordi nal); 2034 AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordinal);
2033 2035
2034 @override 2036 @override
2035 bool callsGetter() => true; 2037 bool callsGetter() => true;
2036 } 2038 }
2037 2039
2038 /** 2040 /**
2039 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</ code> 2041 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</ code>
2040 * property. They are created for every <code>scope['property'] = value;</code> code snippet. 2042 * property. They are created for every <code>scope['property'] = value;</code> code snippet.
2041 */ 2043 */
2042 abstract class AngularScopePropertyElement implements AngularElement { 2044 abstract class AngularScopePropertyElement implements AngularElement {
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST node, in an 2560 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST node, in an
2559 * [AuxiliaryElements]. Since resolved elements are either statically resolved o r resolved 2561 * [AuxiliaryElements]. Since resolved elements are either statically resolved o r resolved
2560 * using propagated type information, this class is a wrapper for a pair of 2562 * using propagated type information, this class is a wrapper for a pair of
2561 * [ExecutableElement]s, not just a single [ExecutableElement]. 2563 * [ExecutableElement]s, not just a single [ExecutableElement].
2562 */ 2564 */
2563 class AuxiliaryElements { 2565 class AuxiliaryElements {
2564 /** 2566 /**
2565 * The element based on propagated type information, or `null` if the AST stru cture has not 2567 * The element based on propagated type information, or `null` if the AST stru cture has not
2566 * been resolved or if this identifier could not be resolved. 2568 * been resolved or if this identifier could not be resolved.
2567 */ 2569 */
2568 final ExecutableElement propagatedElement; 2570 ExecutableElement propagatedElement;
2569 2571
2570 /** 2572 /**
2571 * The element associated with this identifier based on static type informatio n, or `null` 2573 * The element associated with this identifier based on static type informatio n, or `null`
2572 * if the AST structure has not been resolved or if this identifier could not be resolved. 2574 * if the AST structure has not been resolved or if this identifier could not be resolved.
2573 */ 2575 */
2574 final ExecutableElement staticElement; 2576 ExecutableElement staticElement;
2575 2577
2576 /** 2578 /**
2577 * Create the [AuxiliaryElements] with a static and propagated [ExecutableElem ent]. 2579 * Create the [AuxiliaryElements] with a static and propagated [ExecutableElem ent].
2578 * 2580 *
2579 * @param staticElement the static element 2581 * @param staticElement the static element
2580 * @param propagatedElement the propagated element 2582 * @param propagatedElement the propagated element
2581 */ 2583 */
2582 AuxiliaryElements(this.staticElement, this.propagatedElement); 2584 AuxiliaryElements(ExecutableElement staticElement, ExecutableElement propagate dElement) {
2585 this.staticElement = staticElement;
2586 this.propagatedElement = propagatedElement;
2587 }
2583 } 2588 }
2584 2589
2585 /** 2590 /**
2586 * Instances of the class `ClassElementImpl` implement a `ClassElement`. 2591 * Instances of the class `ClassElementImpl` implement a `ClassElement`.
2587 */ 2592 */
2588 class ClassElementImpl extends ElementImpl implements ClassElement { 2593 class ClassElementImpl extends ElementImpl implements ClassElement {
2589 /** 2594 /**
2590 * An array containing all of the accessors (getters and setters) contained in this class. 2595 * An array containing all of the accessors (getters and setters) contained in this class.
2591 */ 2596 */
2592 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A RRAY; 2597 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A RRAY;
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
3656 ElementKind get kind => ElementKind.DYNAMIC; 3661 ElementKind get kind => ElementKind.DYNAMIC;
3657 } 3662 }
3658 3663
3659 /** 3664 /**
3660 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio n]. 3665 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio n].
3661 */ 3666 */
3662 class ElementAnnotationImpl implements ElementAnnotation { 3667 class ElementAnnotationImpl implements ElementAnnotation {
3663 /** 3668 /**
3664 * The element representing the field, variable, or constructor being used as an annotation. 3669 * The element representing the field, variable, or constructor being used as an annotation.
3665 */ 3670 */
3666 final Element element; 3671 Element element;
3667 3672
3668 /** 3673 /**
3669 * An empty array of annotations. 3674 * An empty array of annotations.
3670 */ 3675 */
3671 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp l>(0); 3676 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp l>(0);
3672 3677
3673 /** 3678 /**
3674 * The name of the class used to mark an element as being deprecated. 3679 * The name of the class used to mark an element as being deprecated.
3675 */ 3680 */
3676 static String _DEPRECATED_CLASS_NAME = "Deprecated"; 3681 static String _DEPRECATED_CLASS_NAME = "Deprecated";
(...skipping 13 matching lines...) Expand all
3690 * The name of the top-level variable used to mark a class as implementing a p roxy object. 3695 * The name of the top-level variable used to mark a class as implementing a p roxy object.
3691 */ 3696 */
3692 static String _PROXY_VARIABLE_NAME = "proxy"; 3697 static String _PROXY_VARIABLE_NAME = "proxy";
3693 3698
3694 /** 3699 /**
3695 * Initialize a newly created annotation. 3700 * Initialize a newly created annotation.
3696 * 3701 *
3697 * @param element the element representing the field, variable, or constructor being used as an 3702 * @param element the element representing the field, variable, or constructor being used as an
3698 * annotation 3703 * annotation
3699 */ 3704 */
3700 ElementAnnotationImpl(this.element); 3705 ElementAnnotationImpl(Element element) {
3706 this.element = element;
3707 }
3701 3708
3702 @override 3709 @override
3703 bool get isDeprecated { 3710 bool get isDeprecated {
3704 if (element != null) { 3711 if (element != null) {
3705 LibraryElement library = element.library; 3712 LibraryElement library = element.library;
3706 if (library != null && library.isDartCore) { 3713 if (library != null && library.isDartCore) {
3707 if (element is ConstructorElement) { 3714 if (element is ConstructorElement) {
3708 ConstructorElement constructorElement = element as ConstructorElement; 3715 ConstructorElement constructorElement = element as ConstructorElement;
3709 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME ) { 3716 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME ) {
3710 return true; 3717 return true;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
3791 */ 3798 */
3792 ElementImpl.forNode(Identifier name) : this(name == null ? "" : name.name, nam e == null ? -1 : name.offset); 3799 ElementImpl.forNode(Identifier name) : this(name == null ? "" : name.name, nam e == null ? -1 : name.offset);
3793 3800
3794 /** 3801 /**
3795 * Initialize a newly created element to have the given name. 3802 * Initialize a newly created element to have the given name.
3796 * 3803 *
3797 * @param name the name of this element 3804 * @param name the name of this element
3798 * @param nameOffset the offset of the name of this element in the file that c ontains the 3805 * @param nameOffset the offset of the name of this element in the file that c ontains the
3799 * declaration of this element 3806 * declaration of this element
3800 */ 3807 */
3801 ElementImpl(String name, this.nameOffset) { 3808 ElementImpl(String name, int nameOffset) {
3802 this._name = StringUtilities.intern(name); 3809 this._name = StringUtilities.intern(name);
3810 this.nameOffset = nameOffset;
3803 } 3811 }
3804 3812
3805 @override 3813 @override
3806 String computeDocumentationComment() { 3814 String computeDocumentationComment() {
3807 AnalysisContext context = this.context; 3815 AnalysisContext context = this.context;
3808 if (context == null) { 3816 if (context == null) {
3809 return null; 3817 return null;
3810 } 3818 }
3811 return context.computeDocumentationComment(this); 3819 return context.computeDocumentationComment(this);
3812 } 3820 }
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 } 4263 }
4256 4264
4257 /** 4265 /**
4258 * The class `ElementPair` is a pair of [Element]s. [Object#equals] and 4266 * The class `ElementPair` is a pair of [Element]s. [Object#equals] and
4259 * [Object#hashCode] so this class can be used in hashed data structures. 4267 * [Object#hashCode] so this class can be used in hashed data structures.
4260 */ 4268 */
4261 class ElementPair { 4269 class ElementPair {
4262 /** 4270 /**
4263 * The first [Element] 4271 * The first [Element]
4264 */ 4272 */
4265 final Element _first; 4273 Element _first;
4266 4274
4267 /** 4275 /**
4268 * The second [Element] 4276 * The second [Element]
4269 */ 4277 */
4270 final Element _second; 4278 Element _second;
4271 4279
4272 /** 4280 /**
4273 * The sole constructor for this class, taking two [Element]s. 4281 * The sole constructor for this class, taking two [Element]s.
4274 * 4282 *
4275 * @param first the first element 4283 * @param first the first element
4276 * @param second the second element 4284 * @param second the second element
4277 */ 4285 */
4278 ElementPair(this._first, this._second); 4286 ElementPair(Element first, Element second) {
4287 this._first = first;
4288 this._second = second;
4289 }
4279 4290
4280 @override 4291 @override
4281 bool operator ==(Object object) { 4292 bool operator ==(Object object) {
4282 if (identical(object, this)) { 4293 if (identical(object, this)) {
4283 return true; 4294 return true;
4284 } 4295 }
4285 if (object is ElementPair) { 4296 if (object is ElementPair) {
4286 ElementPair elementPair = object; 4297 ElementPair elementPair = object;
4287 return (_first == elementPair._first) && (_second == elementPair._second); 4298 return (_first == elementPair._first) && (_second == elementPair._second);
4288 } 4299 }
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 */ 4954 */
4944 class HtmlElementImpl extends ElementImpl implements HtmlElement { 4955 class HtmlElementImpl extends ElementImpl implements HtmlElement {
4945 /** 4956 /**
4946 * An empty array of HTML file elements. 4957 * An empty array of HTML file elements.
4947 */ 4958 */
4948 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0); 4959 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0);
4949 4960
4950 /** 4961 /**
4951 * The analysis context in which this library is defined. 4962 * The analysis context in which this library is defined.
4952 */ 4963 */
4953 final AnalysisContext context; 4964 AnalysisContext context;
4954 4965
4955 /** 4966 /**
4956 * The scripts contained in or referenced from script tags in the HTML file. 4967 * The scripts contained in or referenced from script tags in the HTML file.
4957 */ 4968 */
4958 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY; 4969 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
4959 4970
4960 /** 4971 /**
4961 * The source that corresponds to this HTML file. 4972 * The source that corresponds to this HTML file.
4962 */ 4973 */
4963 Source source; 4974 Source source;
4964 4975
4965 /** 4976 /**
4966 * The element associated with Dart pieces in this HTML unit or `null` if the receiver is 4977 * The element associated with Dart pieces in this HTML unit or `null` if the receiver is
4967 * not resolved. 4978 * not resolved.
4968 */ 4979 */
4969 CompilationUnitElement angularCompilationUnit; 4980 CompilationUnitElement angularCompilationUnit;
4970 4981
4971 /** 4982 /**
4972 * Initialize a newly created HTML element to have the given name. 4983 * Initialize a newly created HTML element to have the given name.
4973 * 4984 *
4974 * @param context the analysis context in which the HTML file is defined 4985 * @param context the analysis context in which the HTML file is defined
4975 * @param name the name of this element 4986 * @param name the name of this element
4976 */ 4987 */
4977 HtmlElementImpl(this.context, String name) : super(name, -1); 4988 HtmlElementImpl(AnalysisContext context, String name) : super(name, -1) {
4989 this.context = context;
4990 }
4978 4991
4979 @override 4992 @override
4980 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this); 4993 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this);
4981 4994
4982 @override 4995 @override
4983 bool operator ==(Object object) { 4996 bool operator ==(Object object) {
4984 if (identical(object, this)) { 4997 if (identical(object, this)) {
4985 return true; 4998 return true;
4986 } 4999 }
4987 if (object == null) { 5000 if (object == null) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
5103 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier }@${nameOffset}"; 5116 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier }@${nameOffset}";
5104 } 5117 }
5105 5118
5106 /** 5119 /**
5107 * Instances of the class `LabelElementImpl` implement a `LabelElement`. 5120 * Instances of the class `LabelElementImpl` implement a `LabelElement`.
5108 */ 5121 */
5109 class LabelElementImpl extends ElementImpl implements LabelElement { 5122 class LabelElementImpl extends ElementImpl implements LabelElement {
5110 /** 5123 /**
5111 * A flag indicating whether this label is associated with a `switch` statemen t. 5124 * A flag indicating whether this label is associated with a `switch` statemen t.
5112 */ 5125 */
5113 final bool _onSwitchStatement; 5126 bool _onSwitchStatement = false;
5114 5127
5115 /** 5128 /**
5116 * A flag indicating whether this label is associated with a `switch` member ( `case` 5129 * A flag indicating whether this label is associated with a `switch` member ( `case`
5117 * or `default`). 5130 * or `default`).
5118 */ 5131 */
5119 final bool _onSwitchMember; 5132 bool _onSwitchMember = false;
5120 5133
5121 /** 5134 /**
5122 * An empty array of label elements. 5135 * An empty array of label elements.
5123 */ 5136 */
5124 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0); 5137 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0);
5125 5138
5126 /** 5139 /**
5127 * Initialize a newly created label element to have the given name. 5140 * Initialize a newly created label element to have the given name.
5128 * 5141 *
5129 * @param name the name of this element 5142 * @param name the name of this element
5130 * @param onSwitchStatement `true` if this label is associated with a `switch` 5143 * @param onSwitchStatement `true` if this label is associated with a `switch`
5131 * statement 5144 * statement
5132 * @param onSwitchMember `true` if this label is associated with a `switch` me mber 5145 * @param onSwitchMember `true` if this label is associated with a `switch` me mber
5133 */ 5146 */
5134 LabelElementImpl(Identifier name, this._onSwitchStatement, this._onSwitchMembe r) : super.forNode(name); 5147 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember) : super.forNode(name) {
5148 this._onSwitchStatement = onSwitchStatement;
5149 this._onSwitchMember = onSwitchMember;
5150 }
5135 5151
5136 @override 5152 @override
5137 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); 5153 accept(ElementVisitor visitor) => visitor.visitLabelElement(this);
5138 5154
5139 @override 5155 @override
5140 ExecutableElement get enclosingElement => super.enclosingElement as Executable Element; 5156 ExecutableElement get enclosingElement => super.enclosingElement as Executable Element;
5141 5157
5142 @override 5158 @override
5143 ElementKind get kind => ElementKind.LABEL; 5159 ElementKind get kind => ElementKind.LABEL;
5144 5160
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
5200 return false; 5216 return false;
5201 } 5217 }
5202 } 5218 }
5203 } 5219 }
5204 return true; 5220 return true;
5205 } 5221 }
5206 5222
5207 /** 5223 /**
5208 * The analysis context in which this library is defined. 5224 * The analysis context in which this library is defined.
5209 */ 5225 */
5210 final AnalysisContext context; 5226 AnalysisContext context;
5211 5227
5212 /** 5228 /**
5213 * The compilation unit that defines this library. 5229 * The compilation unit that defines this library.
5214 */ 5230 */
5215 CompilationUnitElement _definingCompilationUnit; 5231 CompilationUnitElement _definingCompilationUnit;
5216 5232
5217 /** 5233 /**
5218 * The entry point for this library, or `null` if this library does not have a n entry point. 5234 * The entry point for this library, or `null` if this library does not have a n entry point.
5219 */ 5235 */
5220 FunctionElement entryPoint; 5236 FunctionElement entryPoint;
(...skipping 18 matching lines...) Expand all
5239 * Is `true` if this library is created for Angular analysis. 5255 * Is `true` if this library is created for Angular analysis.
5240 */ 5256 */
5241 bool _isAngularHtml = false; 5257 bool _isAngularHtml = false;
5242 5258
5243 /** 5259 /**
5244 * Initialize a newly created library element to have the given name. 5260 * Initialize a newly created library element to have the given name.
5245 * 5261 *
5246 * @param context the analysis context in which the library is defined 5262 * @param context the analysis context in which the library is defined
5247 * @param name the name of this element 5263 * @param name the name of this element
5248 */ 5264 */
5249 LibraryElementImpl(this.context, LibraryIdentifier name) : super.forNode(name) ; 5265 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.fo rNode(name) {
5266 this.context = context;
5267 }
5250 5268
5251 @override 5269 @override
5252 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); 5270 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
5253 5271
5254 @override 5272 @override
5255 bool operator ==(Object object) => object != null && runtimeType == object.run timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC ompilationUnit; 5273 bool operator ==(Object object) => object != null && runtimeType == object.run timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC ompilationUnit;
5256 5274
5257 @override 5275 @override
5258 ElementImpl getChild(String identifier) { 5276 ElementImpl getChild(String identifier) {
5259 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i dentifier) { 5277 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i dentifier) {
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
5737 } 5755 }
5738 5756
5739 /** 5757 /**
5740 * The enumeration `Modifier` defines constants for all of the modifiers defined by the Dart 5758 * The enumeration `Modifier` defines constants for all of the modifiers defined by the Dart
5741 * language and for a few additional flags that are useful. 5759 * language and for a few additional flags that are useful.
5742 */ 5760 */
5743 class Modifier extends Enum<Modifier> { 5761 class Modifier extends Enum<Modifier> {
5744 /** 5762 /**
5745 * Indicates that the modifier 'abstract' was applied to the element. 5763 * Indicates that the modifier 'abstract' was applied to the element.
5746 */ 5764 */
5747 static const Modifier ABSTRACT = const Modifier('ABSTRACT', 0); 5765 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0);
5748 5766
5749 /** 5767 /**
5750 * Indicates that the modifier 'const' was applied to the element. 5768 * Indicates that the modifier 'const' was applied to the element.
5751 */ 5769 */
5752 static const Modifier CONST = const Modifier('CONST', 1); 5770 static final Modifier CONST = new Modifier('CONST', 1);
5753 5771
5754 /** 5772 /**
5755 * Indicates that the modifier 'factory' was applied to the element. 5773 * Indicates that the modifier 'factory' was applied to the element.
5756 */ 5774 */
5757 static const Modifier FACTORY = const Modifier('FACTORY', 2); 5775 static final Modifier FACTORY = new Modifier('FACTORY', 2);
5758 5776
5759 /** 5777 /**
5760 * Indicates that the modifier 'final' was applied to the element. 5778 * Indicates that the modifier 'final' was applied to the element.
5761 */ 5779 */
5762 static const Modifier FINAL = const Modifier('FINAL', 3); 5780 static final Modifier FINAL = new Modifier('FINAL', 3);
5763 5781
5764 /** 5782 /**
5765 * Indicates that the pseudo-modifier 'get' was applied to the element. 5783 * Indicates that the pseudo-modifier 'get' was applied to the element.
5766 */ 5784 */
5767 static const Modifier GETTER = const Modifier('GETTER', 4); 5785 static final Modifier GETTER = new Modifier('GETTER', 4);
5768 5786
5769 /** 5787 /**
5770 * A flag used for libraries indicating that the defining compilation unit con tains at least one 5788 * A flag used for libraries indicating that the defining compilation unit con tains at least one
5771 * import directive whose URI uses the "dart-ext" scheme. 5789 * import directive whose URI uses the "dart-ext" scheme.
5772 */ 5790 */
5773 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 5); 5791 static final Modifier HAS_EXT_URI = new Modifier('HAS_EXT_URI', 5);
5774 5792
5775 static const Modifier MIXIN = const Modifier('MIXIN', 6); 5793 static final Modifier MIXIN = new Modifier('MIXIN', 6);
5776 5794
5777 static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 7) ; 5795 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 7);
5778 5796
5779 /** 5797 /**
5780 * Indicates that the pseudo-modifier 'set' was applied to the element. 5798 * Indicates that the pseudo-modifier 'set' was applied to the element.
5781 */ 5799 */
5782 static const Modifier SETTER = const Modifier('SETTER', 8); 5800 static final Modifier SETTER = new Modifier('SETTER', 8);
5783 5801
5784 /** 5802 /**
5785 * Indicates that the modifier 'static' was applied to the element. 5803 * Indicates that the modifier 'static' was applied to the element.
5786 */ 5804 */
5787 static const Modifier STATIC = const Modifier('STATIC', 9); 5805 static final Modifier STATIC = new Modifier('STATIC', 9);
5788 5806
5789 /** 5807 /**
5790 * Indicates that the element does not appear in the source code but was impli citly created. For 5808 * Indicates that the element does not appear in the source code but was impli citly created. For
5791 * example, if a class does not define any constructors, an implicit zero-argu ment constructor 5809 * example, if a class does not define any constructors, an implicit zero-argu ment constructor
5792 * will be created and it will be marked as being synthetic. 5810 * will be created and it will be marked as being synthetic.
5793 */ 5811 */
5794 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 10); 5812 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 10);
5795 5813
5796 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 11); 5814 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 11);
5797 5815
5798 static const List<Modifier> values = const [ 5816 static final List<Modifier> values = [
5799 ABSTRACT, 5817 ABSTRACT,
5800 CONST, 5818 CONST,
5801 FACTORY, 5819 FACTORY,
5802 FINAL, 5820 FINAL,
5803 GETTER, 5821 GETTER,
5804 HAS_EXT_URI, 5822 HAS_EXT_URI,
5805 MIXIN, 5823 MIXIN,
5806 REFERENCES_SUPER, 5824 REFERENCES_SUPER,
5807 SETTER, 5825 SETTER,
5808 STATIC, 5826 STATIC,
5809 SYNTHETIC, 5827 SYNTHETIC,
5810 TYPEDEF]; 5828 TYPEDEF];
5811 5829
5812 const Modifier(String name, int ordinal) : super(name, ordinal); 5830 Modifier(String name, int ordinal) : super(name, ordinal);
5813 } 5831 }
5814 5832
5815 /** 5833 /**
5816 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of elements that 5834 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of elements that
5817 * have the same name within the same scope. 5835 * have the same name within the same scope.
5818 */ 5836 */
5819 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { 5837 class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
5820 /** 5838 /**
5821 * Return an element that represents the given conflicting elements. 5839 * Return an element that represents the given conflicting elements.
5822 * 5840 *
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5864 static List<Element> _computeConflictingElements(Element firstElement, Element secondElement) { 5882 static List<Element> _computeConflictingElements(Element firstElement, Element secondElement) {
5865 Set<Element> elements = new Set<Element>(); 5883 Set<Element> elements = new Set<Element>();
5866 _add(elements, firstElement); 5884 _add(elements, firstElement);
5867 _add(elements, secondElement); 5885 _add(elements, secondElement);
5868 return new List.from(elements); 5886 return new List.from(elements);
5869 } 5887 }
5870 5888
5871 /** 5889 /**
5872 * The analysis context in which the multiply defined elements are defined. 5890 * The analysis context in which the multiply defined elements are defined.
5873 */ 5891 */
5874 final AnalysisContext context; 5892 AnalysisContext context;
5875 5893
5876 /** 5894 /**
5877 * The name of the conflicting elements. 5895 * The name of the conflicting elements.
5878 */ 5896 */
5879 String _name; 5897 String _name;
5880 5898
5881 /** 5899 /**
5882 * A list containing all of the elements that conflict. 5900 * A list containing all of the elements that conflict.
5883 */ 5901 */
5884 final List<Element> conflictingElements; 5902 List<Element> conflictingElements;
5885 5903
5886 /** 5904 /**
5887 * Initialize a newly created element to represent a list of conflicting eleme nts. 5905 * Initialize a newly created element to represent a list of conflicting eleme nts.
5888 * 5906 *
5889 * @param context the analysis context in which the multiply defined elements are defined 5907 * @param context the analysis context in which the multiply defined elements are defined
5890 * @param conflictingElements the elements that conflict 5908 * @param conflictingElements the elements that conflict
5891 */ 5909 */
5892 MultiplyDefinedElementImpl(this.context, this.conflictingElements) { 5910 MultiplyDefinedElementImpl(AnalysisContext context, List<Element> conflictingE lements) {
5911 this.context = context;
5893 _name = conflictingElements[0].name; 5912 _name = conflictingElements[0].name;
5913 this.conflictingElements = conflictingElements;
5894 } 5914 }
5895 5915
5896 @override 5916 @override
5897 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); 5917 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this);
5898 5918
5899 @override 5919 @override
5900 String computeDocumentationComment() => null; 5920 String computeDocumentationComment() => null;
5901 5921
5902 @override 5922 @override
5903 Element getAncestor(Predicate<Element> predicate) => null; 5923 Element getAncestor(Predicate<Element> predicate) => null;
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
6747 builder.append(type); 6767 builder.append(type);
6748 builder.append(" "); 6768 builder.append(" ");
6749 builder.append(displayName); 6769 builder.append(displayName);
6750 } 6770 }
6751 } 6771 }
6752 6772
6753 /** 6773 /**
6754 * Information about Angular application. 6774 * Information about Angular application.
6755 */ 6775 */
6756 class AngularApplication { 6776 class AngularApplication {
6757 final Source entryPoint; 6777 Source entryPoint;
6758 6778
6759 final Set<Source> _librarySources; 6779 Set<Source> _librarySources;
6760 6780
6761 final List<AngularElement> elements; 6781 List<AngularElement> elements;
6762 6782
6763 final List<Source> elementSources; 6783 List<Source> elementSources;
6764 6784
6765 AngularApplication(this.entryPoint, this._librarySources, this.elements, this. elementSources); 6785 AngularApplication(Source entryPoint, Set<Source> librarySources, List<Angular Element> elements, List<Source> elementSources) {
6786 this.entryPoint = entryPoint;
6787 this._librarySources = librarySources;
6788 this.elements = elements;
6789 this.elementSources = elementSources;
6790 }
6766 6791
6767 /** 6792 /**
6768 * Checks if this application depends on the library with the given [Source]. 6793 * Checks if this application depends on the library with the given [Source].
6769 */ 6794 */
6770 bool dependsOn(Source librarySource) => _librarySources.contains(librarySource ); 6795 bool dependsOn(Source librarySource) => _librarySources.contains(librarySource );
6771 } 6796 }
6772 6797
6773 /** 6798 /**
6774 * Implementation of `AngularComponentElement`. 6799 * Implementation of `AngularComponentElement`.
6775 */ 6800 */
6776 class AngularComponentElementImpl extends AngularHasSelectorElementImpl implemen ts AngularComponentElement { 6801 class AngularComponentElementImpl extends AngularHasSelectorElementImpl implemen ts AngularComponentElement {
6777 /** 6802 /**
6778 * The offset of the defining <code>NgComponent</code> annotation. 6803 * The offset of the defining <code>NgComponent</code> annotation.
6779 */ 6804 */
6780 final int _annotationOffset; 6805 int _annotationOffset = 0;
6781 6806
6782 /** 6807 /**
6783 * The array containing all of the properties declared by this component. 6808 * The array containing all of the properties declared by this component.
6784 */ 6809 */
6785 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; 6810 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY;
6786 6811
6787 /** 6812 /**
6788 * The array containing all of the scope properties set by this component. 6813 * The array containing all of the scope properties set by this component.
6789 */ 6814 */
6790 List<AngularScopePropertyElement> _scopeProperties = AngularScopePropertyEleme nt.EMPTY_ARRAY; 6815 List<AngularScopePropertyElement> _scopeProperties = AngularScopePropertyEleme nt.EMPTY_ARRAY;
(...skipping 23 matching lines...) Expand all
6814 */ 6839 */
6815 int templateUriOffset = 0; 6840 int templateUriOffset = 0;
6816 6841
6817 /** 6842 /**
6818 * Initialize a newly created Angular component to have the given name. 6843 * Initialize a newly created Angular component to have the given name.
6819 * 6844 *
6820 * @param name the name of this element 6845 * @param name the name of this element
6821 * @param nameOffset the offset of the name of this element in the file that c ontains the 6846 * @param nameOffset the offset of the name of this element in the file that c ontains the
6822 * declaration of this element 6847 * declaration of this element
6823 */ 6848 */
6824 AngularComponentElementImpl(String name, int nameOffset, this._annotationOffse t) : super(name, nameOffset); 6849 AngularComponentElementImpl(String name, int nameOffset, int annotationOffset) : super(name, nameOffset) {
6850 this._annotationOffset = annotationOffset;
6851 }
6825 6852
6826 @override 6853 @override
6827 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this); 6854 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this);
6828 6855
6829 @override 6856 @override
6830 ElementKind get kind => ElementKind.ANGULAR_COMPONENT; 6857 ElementKind get kind => ElementKind.ANGULAR_COMPONENT;
6831 6858
6832 @override 6859 @override
6833 List<AngularPropertyElement> get properties => _properties; 6860 List<AngularPropertyElement> get properties => _properties;
6834 6861
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
6890 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER; 6917 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER;
6891 } 6918 }
6892 6919
6893 /** 6920 /**
6894 * Implementation of `AngularDirectiveElement`. 6921 * Implementation of `AngularDirectiveElement`.
6895 */ 6922 */
6896 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen ts AngularDirectiveElement { 6923 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen ts AngularDirectiveElement {
6897 /** 6924 /**
6898 * The offset of the annotation that defines this directive. 6925 * The offset of the annotation that defines this directive.
6899 */ 6926 */
6900 final int _offset; 6927 int _offset = 0;
6901 6928
6902 /** 6929 /**
6903 * The array containing all of the properties declared by this directive. 6930 * The array containing all of the properties declared by this directive.
6904 */ 6931 */
6905 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; 6932 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY;
6906 6933
6907 /** 6934 /**
6908 * Initialize a newly created Angular directive to have the given name. 6935 * Initialize a newly created Angular directive to have the given name.
6909 * 6936 *
6910 * @param offset the offset of the annotation that defines this directive 6937 * @param offset the offset of the annotation that defines this directive
6911 */ 6938 */
6912 AngularDirectiveElementImpl(this._offset) : super(null, -1); 6939 AngularDirectiveElementImpl(int offset) : super(null, -1) {
6940 this._offset = offset;
6941 }
6913 6942
6914 @override 6943 @override
6915 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this); 6944 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this);
6916 6945
6917 @override 6946 @override
6918 String get displayName => selector.displayName; 6947 String get displayName => selector.displayName;
6919 6948
6920 @override 6949 @override
6921 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE; 6950 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE;
6922 6951
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
7100 ElementKind get kind => ElementKind.ANGULAR_PROPERTY; 7129 ElementKind get kind => ElementKind.ANGULAR_PROPERTY;
7101 } 7130 }
7102 7131
7103 /** 7132 /**
7104 * Implementation of `AngularScopePropertyElement`. 7133 * Implementation of `AngularScopePropertyElement`.
7105 */ 7134 */
7106 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu larScopePropertyElement { 7135 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu larScopePropertyElement {
7107 /** 7136 /**
7108 * The type of the property 7137 * The type of the property
7109 */ 7138 */
7110 final DartType type; 7139 DartType type;
7111 7140
7112 /** 7141 /**
7113 * Initialize a newly created Angular scope property to have the given name. 7142 * Initialize a newly created Angular scope property to have the given name.
7114 * 7143 *
7115 * @param name the name of this element 7144 * @param name the name of this element
7116 * @param nameOffset the offset of the name of this element in the file that c ontains the 7145 * @param nameOffset the offset of the name of this element in the file that c ontains the
7117 * declaration of this element 7146 * declaration of this element
7118 */ 7147 */
7119 AngularScopePropertyElementImpl(String name, int nameOffset, this.type) : supe r(name, nameOffset); 7148 AngularScopePropertyElementImpl(String name, int nameOffset, DartType type) : super(name, nameOffset) {
7149 this.type = type;
7150 }
7120 7151
7121 @override 7152 @override
7122 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi s); 7153 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi s);
7123 7154
7124 @override 7155 @override
7125 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY; 7156 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY;
7126 } 7157 }
7127 7158
7128 /** 7159 /**
7129 * Implementation of `AngularFilterElement`. 7160 * Implementation of `AngularFilterElement`.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
7161 AngularApplication get application => (enclosingElement as AngularElementImpl) .application; 7192 AngularApplication get application => (enclosingElement as AngularElementImpl) .application;
7162 } 7193 }
7163 7194
7164 /** 7195 /**
7165 * Implementation of `AngularViewElement`. 7196 * Implementation of `AngularViewElement`.
7166 */ 7197 */
7167 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl ement { 7198 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl ement {
7168 /** 7199 /**
7169 * The HTML template URI. 7200 * The HTML template URI.
7170 */ 7201 */
7171 final String templateUri; 7202 String templateUri;
7172 7203
7173 /** 7204 /**
7174 * The offset of the [templateUri] in the [getSource]. 7205 * The offset of the [templateUri] in the [getSource].
7175 */ 7206 */
7176 final int templateUriOffset; 7207 int templateUriOffset = 0;
7177 7208
7178 /** 7209 /**
7179 * The HTML template source. 7210 * The HTML template source.
7180 */ 7211 */
7181 Source templateSource; 7212 Source templateSource;
7182 7213
7183 /** 7214 /**
7184 * Initialize a newly created Angular view. 7215 * Initialize a newly created Angular view.
7185 */ 7216 */
7186 AngularViewElementImpl(this.templateUri, this.templateUriOffset) : super(null, -1); 7217 AngularViewElementImpl(String templateUri, int templateUriOffset) : super(null , -1) {
7218 this.templateUri = templateUri;
7219 this.templateUriOffset = templateUriOffset;
7220 }
7187 7221
7188 @override 7222 @override
7189 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this); 7223 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this);
7190 7224
7191 @override 7225 @override
7192 ElementKind get kind => ElementKind.ANGULAR_VIEW; 7226 ElementKind get kind => ElementKind.ANGULAR_VIEW;
7193 7227
7194 @override 7228 @override
7195 String get identifier => "AngularView@${templateUriOffset}"; 7229 String get identifier => "AngularView@${templateUriOffset}";
7196 } 7230 }
(...skipping 15 matching lines...) Expand all
7212 builder.append("["); 7246 builder.append("[");
7213 builder.append(name); 7247 builder.append(name);
7214 builder.append("]"); 7248 builder.append("]");
7215 } 7249 }
7216 } 7250 }
7217 7251
7218 /** 7252 /**
7219 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme ntImpl]. 7253 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme ntImpl].
7220 */ 7254 */
7221 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl { 7255 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl {
7222 final String tagName; 7256 String tagName;
7223 7257
7224 final String attributeName; 7258 String attributeName;
7225 7259
7226 IsTagHasAttributeSelectorElementImpl(this.tagName, this.attributeName) : super (null, -1); 7260 IsTagHasAttributeSelectorElementImpl(String tagName, String attributeName) : s uper(null, -1) {
7261 this.tagName = tagName;
7262 this.attributeName = attributeName;
7263 }
7227 7264
7228 @override 7265 @override
7229 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib uteName) != null; 7266 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib uteName) != null;
7230 } 7267 }
7231 7268
7232 /** 7269 /**
7233 * Instances of the class `ConstructorMember` represent a constructor element de fined in a 7270 * Instances of the class `ConstructorMember` represent a constructor element de fined in a
7234 * parameterized type where the values of the type parameters are known. 7271 * parameterized type where the values of the type parameters are known.
7235 */ 7272 */
7236 class ConstructorMember extends ExecutableMember implements ConstructorElement { 7273 class ConstructorMember extends ExecutableMember implements ConstructorElement {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
7490 } 7527 }
7491 7528
7492 /** 7529 /**
7493 * The abstract class `Member` defines the behavior common to elements that repr esent members 7530 * The abstract class `Member` defines the behavior common to elements that repr esent members
7494 * of parameterized types. 7531 * of parameterized types.
7495 */ 7532 */
7496 abstract class Member implements Element { 7533 abstract class Member implements Element {
7497 /** 7534 /**
7498 * The element on which the parameterized element was created. 7535 * The element on which the parameterized element was created.
7499 */ 7536 */
7500 final Element _baseElement; 7537 Element _baseElement;
7501 7538
7502 /** 7539 /**
7503 * The type in which the element is defined. 7540 * The type in which the element is defined.
7504 */ 7541 */
7505 final ParameterizedType _definingType; 7542 ParameterizedType _definingType;
7506 7543
7507 /** 7544 /**
7508 * Initialize a newly created element to represent the member of the given par ameterized type. 7545 * Initialize a newly created element to represent the member of the given par ameterized type.
7509 * 7546 *
7510 * @param baseElement the element on which the parameterized element was creat ed 7547 * @param baseElement the element on which the parameterized element was creat ed
7511 * @param definingType the type in which the element is defined 7548 * @param definingType the type in which the element is defined
7512 */ 7549 */
7513 Member(this._baseElement, this._definingType); 7550 Member(Element baseElement, ParameterizedType definingType) {
7551 this._baseElement = baseElement;
7552 this._definingType = definingType;
7553 }
7514 7554
7515 @override 7555 @override
7516 String computeDocumentationComment() => _baseElement.computeDocumentationComme nt(); 7556 String computeDocumentationComment() => _baseElement.computeDocumentationComme nt();
7517 7557
7518 @override 7558 @override
7519 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p redicate); 7559 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p redicate);
7520 7560
7521 /** 7561 /**
7522 * Return the element on which the parameterized element was created. 7562 * Return the element on which the parameterized element was created.
7523 * 7563 *
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
9482 for (int i = 0; i < length; i++) { 9522 for (int i = 0; i < length; i++) {
9483 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); 9523 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes);
9484 } 9524 }
9485 return newTypes; 9525 return newTypes;
9486 } 9526 }
9487 9527
9488 /** 9528 /**
9489 * The element representing the declaration of this type, or `null` if the typ e has not, or 9529 * The element representing the declaration of this type, or `null` if the typ e has not, or
9490 * cannot, be associated with an element. 9530 * cannot, be associated with an element.
9491 */ 9531 */
9492 final Element _element; 9532 Element _element;
9493 9533
9494 /** 9534 /**
9495 * The name of this type, or `null` if the type does not have a name. 9535 * The name of this type, or `null` if the type does not have a name.
9496 */ 9536 */
9497 final String name; 9537 String name;
9498 9538
9499 /** 9539 /**
9500 * An empty array of types. 9540 * An empty array of types.
9501 */ 9541 */
9502 static List<DartType> EMPTY_ARRAY = new List<DartType>(0); 9542 static List<DartType> EMPTY_ARRAY = new List<DartType>(0);
9503 9543
9504 /** 9544 /**
9505 * Initialize a newly created type to be declared by the given element and to have the given name. 9545 * Initialize a newly created type to be declared by the given element and to have the given name.
9506 * 9546 *
9507 * @param element the element representing the declaration of the type 9547 * @param element the element representing the declaration of the type
9508 * @param name the name of the type 9548 * @param name the name of the type
9509 */ 9549 */
9510 TypeImpl(this._element, this.name); 9550 TypeImpl(Element element, String name) {
9551 this._element = element;
9552 this.name = name;
9553 }
9511 9554
9512 @override 9555 @override
9513 String get displayName => name; 9556 String get displayName => name;
9514 9557
9515 @override 9558 @override
9516 Element get element => _element; 9559 Element get element => _element;
9517 9560
9518 @override 9561 @override
9519 DartType getLeastUpperBound(DartType type) => null; 9562 DartType getLeastUpperBound(DartType type) => null;
9520 9563
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
9626 } 9669 }
9627 9670
9628 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs); 9671 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs);
9629 9672
9630 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_ TypePair> visitedTypePairs); 9673 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_ TypePair> visitedTypePairs);
9631 9674
9632 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair s); 9675 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair s);
9633 } 9676 }
9634 9677
9635 class TypeImpl_TypePair { 9678 class TypeImpl_TypePair {
9636 final DartType _firstType; 9679 DartType _firstType;
9637 9680
9638 final DartType _secondType; 9681 DartType _secondType;
9639 9682
9640 int _cachedHashCode = 0; 9683 int _cachedHashCode = 0;
9641 9684
9642 TypeImpl_TypePair(this._firstType, this._secondType); 9685 TypeImpl_TypePair(DartType firstType, DartType secondType) {
9686 this._firstType = firstType;
9687 this._secondType = secondType;
9688 }
9643 9689
9644 @override 9690 @override
9645 bool operator ==(Object object) { 9691 bool operator ==(Object object) {
9646 if (identical(object, this)) { 9692 if (identical(object, this)) {
9647 return true; 9693 return true;
9648 } 9694 }
9649 if (object is TypeImpl_TypePair) { 9695 if (object is TypeImpl_TypePair) {
9650 TypeImpl_TypePair typePair = object; 9696 TypeImpl_TypePair typePair = object;
9651 return _firstType == typePair._firstType && _secondType != null && _second Type == typePair._secondType; 9697 return _firstType == typePair._firstType && _secondType != null && _second Type == typePair._secondType;
9652 } 9698 }
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
10415 } 10461 }
10416 10462
10417 /** 10463 /**
10418 * The interface `VoidType` defines the behavior of the unique object representi ng the type 10464 * The interface `VoidType` defines the behavior of the unique object representi ng the type
10419 * `void`. 10465 * `void`.
10420 */ 10466 */
10421 abstract class VoidType implements DartType { 10467 abstract class VoidType implements DartType {
10422 @override 10468 @override
10423 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp es); 10469 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp es);
10424 } 10470 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698