OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 | 3 |
4 library engine.element; | 4 library engine.element; |
5 | 5 |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'java_core.dart'; | 7 import 'java_core.dart'; |
8 import 'java_engine.dart'; | 8 import 'java_engine.dart'; |
9 import 'utilities_collection.dart'; | 9 import 'utilities_collection.dart'; |
10 import 'source.dart'; | 10 import 'source.dart'; |
(...skipping 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3885 * visible range. | 3885 * visible range. |
3886 */ | 3886 */ |
3887 int _visibleRangeLength = -1; | 3887 int _visibleRangeLength = -1; |
3888 | 3888 |
3889 /** | 3889 /** |
3890 * An empty array of function elements. | 3890 * An empty array of function elements. |
3891 */ | 3891 */ |
3892 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0); | 3892 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0); |
3893 | 3893 |
3894 /** | 3894 /** |
3895 * Initialize a newly created synthetic function element. | |
3896 */ | |
3897 FunctionElementImpl() : super.con2("", -1) { | |
3898 synthetic = true; | |
3899 } | |
3900 | |
3901 /** | |
3902 * Initialize a newly created function element to have the given name. | 3895 * Initialize a newly created function element to have the given name. |
3903 * | 3896 * |
3904 * @param name the name of this element | 3897 * @param name the name of this element |
3905 */ | 3898 */ |
3906 FunctionElementImpl.con1(Identifier name) : super.con1(name); | 3899 FunctionElementImpl.con1(Identifier name) : super.con1(name); |
3907 | 3900 |
3908 /** | 3901 /** |
3909 * Initialize a newly created function element to have no name and the given o
ffset. This is used | 3902 * Initialize a newly created function element to have no name and the given o
ffset. This is used |
3910 * for function expressions, which have no name. | 3903 * for function expressions, which have no name. |
3911 * | 3904 * |
3912 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3905 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
3913 * declaration of this element | 3906 * declaration of this element |
3914 */ | 3907 */ |
3915 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset); | 3908 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset); |
3916 | 3909 |
3917 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); | 3910 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); |
3918 | 3911 |
3919 /** | |
3920 * Treating the set of arrays defined in [ExecutableElementImpl] as one long a
rray, this | |
3921 * returns the index position of the passed child in this [FunctionElement]. T
his gives a | |
3922 * unique integer for each element, this is provided primarily for function el
ements that do not | |
3923 * have a name (closures), which cannot use [Element#getNameOffset]. If there
is no such | |
3924 * element, `-1` is returned. | |
3925 * | |
3926 * @param element the element to find and return an integer for, if there is n
o such element, | |
3927 * `-1` is returned | |
3928 */ | |
3929 int getIndexPosition(Element element) { | |
3930 List<FunctionElement> functions = this.functions; | |
3931 List<LabelElement> labels = this.labels; | |
3932 List<LocalVariableElement> localVariables = this.localVariables; | |
3933 List<ParameterElement> parameters = this.parameters; | |
3934 int count = 0; | |
3935 for (int i = 0; i < functions.length; i++, count++) { | |
3936 if (identical(element, functions[i])) { | |
3937 return count; | |
3938 } | |
3939 } | |
3940 for (int i = 0; i < labels.length; i++, count++) { | |
3941 if (identical(element, labels[i])) { | |
3942 return count; | |
3943 } | |
3944 } | |
3945 for (int i = 0; i < localVariables.length; i++, count++) { | |
3946 if (identical(element, localVariables[i])) { | |
3947 return count; | |
3948 } | |
3949 } | |
3950 for (int i = 0; i < parameters.length; i++, count++) { | |
3951 if (identical(element, parameters[i])) { | |
3952 return count; | |
3953 } | |
3954 } | |
3955 return -1; | |
3956 } | |
3957 | |
3958 ElementKind get kind => ElementKind.FUNCTION; | 3912 ElementKind get kind => ElementKind.FUNCTION; |
3959 | 3913 |
3960 SourceRange get visibleRange { | 3914 SourceRange get visibleRange { |
3961 if (_visibleRangeLength < 0) { | 3915 if (_visibleRangeLength < 0) { |
3962 return null; | 3916 return null; |
3963 } | 3917 } |
3964 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 3918 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
3965 } | 3919 } |
3966 | 3920 |
3967 bool get isStatic => enclosingElement is CompilationUnitElement; | 3921 bool get isStatic => enclosingElement is CompilationUnitElement; |
(...skipping 4721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8689 | 8643 |
8690 /** | 8644 /** |
8691 * The interface `VoidType` defines the behavior of the unique object representi
ng the type | 8645 * The interface `VoidType` defines the behavior of the unique object representi
ng the type |
8692 * `void`. | 8646 * `void`. |
8693 * | 8647 * |
8694 * @coverage dart.engine.type | 8648 * @coverage dart.engine.type |
8695 */ | 8649 */ |
8696 abstract class VoidType implements Type2 { | 8650 abstract class VoidType implements Type2 { |
8697 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 8651 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
8698 } | 8652 } |
OLD | NEW |