| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 class SynthesizedConstructorElement extends FunctionElement { | 673 class SynthesizedConstructorElement extends FunctionElement { |
| 674 SynthesizedConstructorElement(Element enclosing) | 674 SynthesizedConstructorElement(Element enclosing) |
| 675 : super(enclosing.name, ElementKind.GENERATIVE_CONSTRUCTOR, | 675 : super(enclosing.name, ElementKind.GENERATIVE_CONSTRUCTOR, |
| 676 null, enclosing); | 676 null, enclosing); |
| 677 | 677 |
| 678 Token position() => enclosingElement.position(); | 678 Token position() => enclosingElement.position(); |
| 679 } | 679 } |
| 680 | 680 |
| 681 class VoidElement extends Element { | 681 class VoidElement extends Element { |
| 682 VoidElement(Element enclosing) | 682 VoidElement(Element enclosing) |
| 683 : super(Types.VOID, ElementKind.VOID, enclosing); | 683 : super(const SourceString('void'), ElementKind.VOID, enclosing); |
| 684 Type computeType(compiler) => compiler.types.voidType; | 684 Type computeType(compiler) => compiler.types.voidType; |
| 685 Node parseNode(_) { | 685 Node parseNode(_) { |
| 686 throw 'internal error: parseNode on void'; | 686 throw 'internal error: parseNode on void'; |
| 687 } | 687 } |
| 688 bool impliesType() => true; | 688 bool impliesType() => true; |
| 689 } | 689 } |
| 690 | 690 |
| 691 class ClassElement extends ContainerElement { | 691 class ClassElement extends ContainerElement { |
| 692 final int id; | 692 final int id; |
| 693 Type type; | 693 Type type; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 final Node node; | 1059 final Node node; |
| 1060 Type bound; | 1060 Type bound; |
| 1061 Type type; | 1061 Type type; |
| 1062 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1062 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1063 [this.bound]) | 1063 [this.bound]) |
| 1064 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1064 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1065 Type computeType(compiler) => type; | 1065 Type computeType(compiler) => type; |
| 1066 Node parseNode(compiler) => node; | 1066 Node parseNode(compiler) => node; |
| 1067 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1067 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1068 } | 1068 } |
| OLD | NEW |