| 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('../tree/tree.dart'); | 7 #import('../tree/tree.dart'); |
| 8 #import('../scanner/scannerlib.dart'); | 8 #import('../scanner/scannerlib.dart'); |
| 9 #import('../leg.dart'); // TODO(karlklose): we only need type. | 9 #import('../leg.dart'); // TODO(karlklose): we only need type. |
| 10 #import('../util/util.dart'); | 10 #import('../util/util.dart'); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 super(prefix, ElementKind.PREFIX, enclosing); | 326 super(prefix, ElementKind.PREFIX, enclosing); |
| 327 | 327 |
| 328 lookupLocalMember(SourceString memberName) => imported[memberName]; | 328 lookupLocalMember(SourceString memberName) => imported[memberName]; |
| 329 | 329 |
| 330 Type computeType(Compiler compiler) => compiler.types.dynamicType; | 330 Type computeType(Compiler compiler) => compiler.types.dynamicType; |
| 331 | 331 |
| 332 Token position() => firstPosition; | 332 Token position() => firstPosition; |
| 333 } | 333 } |
| 334 | 334 |
| 335 class TypedefElement extends Element { | 335 class TypedefElement extends Element { |
| 336 Token token; | 336 final Token token; |
| 337 Type cachedType; |
| 338 |
| 337 TypedefElement(SourceString name, Element enclosing, this.token) | 339 TypedefElement(SourceString name, Element enclosing, this.token) |
| 338 : super(name, ElementKind.TYPEDEF, enclosing); | 340 : super(name, ElementKind.TYPEDEF, enclosing) { |
| 341 cachedType = new InterfaceType(name, this); |
| 342 } |
| 339 | 343 |
| 340 position() => findMyName(token); | 344 position() => findMyName(token); |
| 345 |
| 346 Type computeType(Compiler compiler) => cachedType; |
| 341 } | 347 } |
| 342 | 348 |
| 343 class VariableElement extends Element { | 349 class VariableElement extends Element { |
| 344 final VariableListElement variables; | 350 final VariableListElement variables; |
| 345 Expression cachedNode; // The send or the identifier in the variables list. | 351 Expression cachedNode; // The send or the identifier in the variables list. |
| 346 | 352 |
| 347 Modifiers get modifiers() => variables.modifiers; | 353 Modifiers get modifiers() => variables.modifiers; |
| 348 | 354 |
| 349 VariableElement(SourceString name, | 355 VariableElement(SourceString name, |
| 350 VariableListElement this.variables, | 356 VariableListElement this.variables, |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 final Node node; | 1051 final Node node; |
| 1046 Type bound; | 1052 Type bound; |
| 1047 Type type; | 1053 Type type; |
| 1048 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1054 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1049 [this.bound]) | 1055 [this.bound]) |
| 1050 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1056 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1051 Type computeType(compiler) => type; | 1057 Type computeType(compiler) => type; |
| 1052 Node parseNode(compiler) => node; | 1058 Node parseNode(compiler) => node; |
| 1053 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1059 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1054 } | 1060 } |
| OLD | NEW |