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 |
floitsch
2013/02/26 13:54:19
All these files in the "generated" directory are l
Lasse Reichstein Nielsen
2013/02/26 15:26:00
WTF is generated code doing in the repository.
Sin
| |
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.resolver; | 4 library engine.resolver; |
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 'source.dart'; | 9 import 'source.dart'; |
10 import 'error.dart'; | 10 import 'error.dart'; |
11 import 'scanner.dart' show Keyword, TokenType, Token, KeywordToken, StringToken; | 11 import 'scanner.dart' show Keyword, TokenType, Token, KeywordToken, StringToken; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 } | 118 } |
119 element.abstract = node.abstractKeyword != null; | 119 element.abstract = node.abstractKeyword != null; |
120 element.accessors = holder.accessors; | 120 element.accessors = holder.accessors; |
121 element.constructors = constructors3; | 121 element.constructors = constructors3; |
122 element.fields = holder.fields; | 122 element.fields = holder.fields; |
123 element.methods = holder.methods; | 123 element.methods = holder.methods; |
124 List<TypeVariableElement> typeVariables4 = holder.typeVariables; | 124 List<TypeVariableElement> typeVariables4 = holder.typeVariables; |
125 element.typeVariables = typeVariables4; | 125 element.typeVariables = typeVariables4; |
126 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element); | 126 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element); |
127 int typeVariableCount = typeVariables4.length; | 127 int typeVariableCount = typeVariables4.length; |
128 List<Type2> typeArguments = new List<Type2>.fixedLength(typeVariableCount); | 128 List<Type2> typeArguments = new List<Type2>(typeVariableCount); |
129 for (int i = 0; i < typeVariableCount; i++) { | 129 for (int i = 0; i < typeVariableCount; i++) { |
130 TypeVariableElementImpl typeVariable = (typeVariables4[i] as TypeVariableE lementImpl); | 130 TypeVariableElementImpl typeVariable = (typeVariables4[i] as TypeVariableE lementImpl); |
131 TypeVariableTypeImpl typeArgument = new TypeVariableTypeImpl(typeVariable) ; | 131 TypeVariableTypeImpl typeArgument = new TypeVariableTypeImpl(typeVariable) ; |
132 typeVariable.type = typeArgument; | 132 typeVariable.type = typeArgument; |
133 typeArguments[i] = typeArgument; | 133 typeArguments[i] = typeArgument; |
134 } | 134 } |
135 interfaceType.typeArguments = typeArguments; | 135 interfaceType.typeArguments = typeArguments; |
136 element.type = interfaceType; | 136 element.type = interfaceType; |
137 _currentHolder.addType(element); | 137 _currentHolder.addType(element); |
138 className.element = element; | 138 className.element = element; |
139 return null; | 139 return null; |
140 } | 140 } |
141 Object visitClassTypeAlias(ClassTypeAlias node) { | 141 Object visitClassTypeAlias(ClassTypeAlias node) { |
142 ElementHolder holder = new ElementHolder(); | 142 ElementHolder holder = new ElementHolder(); |
143 visitChildren(holder, node); | 143 visitChildren(holder, node); |
144 SimpleIdentifier className = node.name; | 144 SimpleIdentifier className = node.name; |
145 ClassElementImpl element = new ClassElementImpl(className); | 145 ClassElementImpl element = new ClassElementImpl(className); |
146 element.abstract = node.abstractKeyword != null; | 146 element.abstract = node.abstractKeyword != null; |
147 List<TypeVariableElement> typeVariables5 = holder.typeVariables; | 147 List<TypeVariableElement> typeVariables5 = holder.typeVariables; |
148 element.typeVariables = typeVariables5; | 148 element.typeVariables = typeVariables5; |
149 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element); | 149 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element); |
150 int typeVariableCount = typeVariables5.length; | 150 int typeVariableCount = typeVariables5.length; |
151 List<Type2> typeArguments = new List<Type2>.fixedLength(typeVariableCount); | 151 List<Type2> typeArguments = new List<Type2>(typeVariableCount); |
152 for (int i = 0; i < typeVariableCount; i++) { | 152 for (int i = 0; i < typeVariableCount; i++) { |
153 TypeVariableElementImpl typeVariable = (typeVariables5[i] as TypeVariableE lementImpl); | 153 TypeVariableElementImpl typeVariable = (typeVariables5[i] as TypeVariableE lementImpl); |
154 TypeVariableTypeImpl typeArgument = new TypeVariableTypeImpl(typeVariable) ; | 154 TypeVariableTypeImpl typeArgument = new TypeVariableTypeImpl(typeVariable) ; |
155 typeVariable.type = typeArgument; | 155 typeVariable.type = typeArgument; |
156 typeArguments[i] = typeArgument; | 156 typeArguments[i] = typeArgument; |
157 } | 157 } |
158 interfaceType.typeArguments = typeArguments; | 158 interfaceType.typeArguments = typeArguments; |
159 element.type = interfaceType; | 159 element.type = interfaceType; |
160 _currentHolder.addType(element); | 160 _currentHolder.addType(element); |
161 className.element = element; | 161 className.element = element; |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1989 _libraryMap[librarySource] = library; | 1989 _libraryMap[librarySource] = library; |
1990 return library; | 1990 return library; |
1991 } | 1991 } |
1992 /** | 1992 /** |
1993 * Return an array containing the lexical identifiers associated with the node s in the given list. | 1993 * Return an array containing the lexical identifiers associated with the node s in the given list. |
1994 * @param names the AST nodes representing the identifiers | 1994 * @param names the AST nodes representing the identifiers |
1995 * @return the lexical identifiers associated with the nodes in the list | 1995 * @return the lexical identifiers associated with the nodes in the list |
1996 */ | 1996 */ |
1997 List<String> getIdentifiers(NodeList<SimpleIdentifier> names) { | 1997 List<String> getIdentifiers(NodeList<SimpleIdentifier> names) { |
1998 int count = names.length; | 1998 int count = names.length; |
1999 List<String> identifiers = new List<String>.fixedLength(count); | 1999 List<String> identifiers = new List<String>(count); |
2000 for (int i = 0; i < count; i++) { | 2000 for (int i = 0; i < count; i++) { |
2001 identifiers[i] = names[i].name; | 2001 identifiers[i] = names[i].name; |
2002 } | 2002 } |
2003 return identifiers; | 2003 return identifiers; |
2004 } | 2004 } |
2005 /** | 2005 /** |
2006 * As the final step in the process, record the resolved element models with t he analysis context. | 2006 * As the final step in the process, record the resolved element models with t he analysis context. |
2007 */ | 2007 */ |
2008 void recordLibraryElements() { | 2008 void recordLibraryElements() { |
2009 Map<Source, LibraryElement> elementMap = new Map<Source, LibraryElement>(); | 2009 Map<Source, LibraryElement> elementMap = new Map<Source, LibraryElement>(); |
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3529 type = functionType.substitute4(new List.from(typeArguments)); | 3529 type = functionType.substitute4(new List.from(typeArguments)); |
3530 } else { | 3530 } else { |
3531 } | 3531 } |
3532 } else { | 3532 } else { |
3533 } | 3533 } |
3534 } else { | 3534 } else { |
3535 List<Type2> parameters = getTypeArguments(type); | 3535 List<Type2> parameters = getTypeArguments(type); |
3536 int parameterCount = parameters.length; | 3536 int parameterCount = parameters.length; |
3537 if (parameterCount > 0) { | 3537 if (parameterCount > 0) { |
3538 DynamicTypeImpl dynamicType = DynamicTypeImpl.instance; | 3538 DynamicTypeImpl dynamicType = DynamicTypeImpl.instance; |
3539 List<Type2> arguments = new List<Type2>.fixedLength(parameterCount); | 3539 List<Type2> arguments = new List<Type2>(parameterCount); |
3540 for (int i = 0; i < parameterCount; i++) { | 3540 for (int i = 0; i < parameterCount; i++) { |
3541 arguments[i] = dynamicType; | 3541 arguments[i] = dynamicType; |
3542 } | 3542 } |
3543 type = type.substitute2(arguments, parameters); | 3543 type = type.substitute2(arguments, parameters); |
3544 } | 3544 } |
3545 } | 3545 } |
3546 typeName.staticType = type; | 3546 typeName.staticType = type; |
3547 node.type = type; | 3547 node.type = type; |
3548 return null; | 3548 return null; |
3549 } | 3549 } |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4470 ResolverErrorCode(this.__name, this.__ordinal, ErrorType type, String message) { | 4470 ResolverErrorCode(this.__name, this.__ordinal, ErrorType type, String message) { |
4471 this._type = type; | 4471 this._type = type; |
4472 this._message = message; | 4472 this._message = message; |
4473 } | 4473 } |
4474 ErrorSeverity get errorSeverity => _type.severity; | 4474 ErrorSeverity get errorSeverity => _type.severity; |
4475 String get message => _message; | 4475 String get message => _message; |
4476 ErrorType get type => _type; | 4476 ErrorType get type => _type; |
4477 bool needsRecompilation() => true; | 4477 bool needsRecompilation() => true; |
4478 String toString() => __name; | 4478 String toString() => __name; |
4479 } | 4479 } |
OLD | NEW |