| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #library('elements'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 TypeVariableElement variableElement = | 1297 TypeVariableElement variableElement = |
| 1298 new TypeVariableElement(variableName, element, node); | 1298 new TypeVariableElement(variableName, element, node); |
| 1299 TypeVariableType variableType = new TypeVariableType(variableElement); | 1299 TypeVariableType variableType = new TypeVariableType(variableElement); |
| 1300 variableElement.type = variableType; | 1300 variableElement.type = variableType; |
| 1301 arguments.addLast(variableType); | 1301 arguments.addLast(variableType); |
| 1302 } | 1302 } |
| 1303 return arguments.toLink(); | 1303 return arguments.toLink(); |
| 1304 } | 1304 } |
| 1305 } | 1305 } |
| 1306 | 1306 |
| 1307 class ClassElement extends ScopeContainerElement | 1307 abstract class ClassElement extends ScopeContainerElement |
| 1308 implements TypeDeclarationElement { | 1308 implements TypeDeclarationElement { |
| 1309 final int id; | 1309 final int id; |
| 1310 InterfaceType type; | 1310 InterfaceType type; |
| 1311 DartType supertype; | 1311 DartType supertype; |
| 1312 DartType defaultClass; | 1312 DartType defaultClass; |
| 1313 Link<DartType> interfaces; | 1313 Link<DartType> interfaces; |
| 1314 SourceString nativeName; | 1314 SourceString nativeName; |
| 1315 int supertypeLoadState; | 1315 int supertypeLoadState; |
| 1316 int resolutionState; | 1316 int resolutionState; |
| 1317 | 1317 |
| 1318 // backendMembers are members that have been added by the backend to simplify | 1318 // backendMembers are members that have been added by the backend to simplify |
| 1319 // compilation. They don't have any user-side counter-part. | 1319 // compilation. They don't have any user-side counter-part. |
| 1320 Link<Element> backendMembers = const EmptyLink<Element>(); | 1320 Link<Element> backendMembers = const EmptyLink<Element>(); |
| 1321 | 1321 |
| 1322 Link<DartType> allSupertypes; | 1322 Link<DartType> allSupertypes; |
| 1323 | 1323 |
| 1324 // Lazily applied patch of class members. | 1324 // Lazily applied patch of class members. |
| 1325 ClassElement patch = null; | 1325 ClassElement patch = null; |
| 1326 ClassElement origin = null; | 1326 ClassElement origin = null; |
| 1327 | 1327 |
| 1328 ClassElement(SourceString name, Element enclosing, this.id, int initialState) | 1328 ClassElement(SourceString name, Element enclosing, this.id, int initialState) |
| 1329 : supertypeLoadState = initialState, | 1329 : supertypeLoadState = initialState, |
| 1330 resolutionState = initialState, | 1330 resolutionState = initialState, |
| 1331 super(name, ElementKind.CLASS, enclosing); | 1331 super(name, ElementKind.CLASS, enclosing); |
| 1332 | 1332 |
| 1333 abstract ClassNode parseNode(Compiler compiler); |
| 1334 |
| 1333 InterfaceType computeType(compiler) { | 1335 InterfaceType computeType(compiler) { |
| 1334 if (type == null) { | 1336 if (type == null) { |
| 1335 if (origin === null) { | 1337 if (origin === null) { |
| 1336 ClassNode node = parseNode(compiler); | 1338 ClassNode node = parseNode(compiler); |
| 1337 Link<DartType> parameters = | 1339 Link<DartType> parameters = |
| 1338 TypeDeclarationElement.createTypeVariables(this, | 1340 TypeDeclarationElement.createTypeVariables(this, |
| 1339 node.typeParameters); | 1341 node.typeParameters); |
| 1340 type = new InterfaceType(this, parameters); | 1342 type = new InterfaceType(this, parameters); |
| 1341 } else { | 1343 } else { |
| 1342 type = origin.computeType(compiler); | 1344 type = origin.computeType(compiler); |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 | 1966 |
| 1965 MetadataAnnotation ensureResolved(Compiler compiler) { | 1967 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1966 if (resolutionState == STATE_NOT_STARTED) { | 1968 if (resolutionState == STATE_NOT_STARTED) { |
| 1967 compiler.resolver.resolveMetadataAnnotation(this); | 1969 compiler.resolver.resolveMetadataAnnotation(this); |
| 1968 } | 1970 } |
| 1969 return this; | 1971 return this; |
| 1970 } | 1972 } |
| 1971 | 1973 |
| 1972 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1974 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1973 } | 1975 } |
| OLD | NEW |