| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 FunctionType computeType(Compiler compiler) { | 709 FunctionType computeType(Compiler compiler) { |
| 710 if (type != null) return type; | 710 if (type != null) return type; |
| 711 type = compiler.computeFunctionType(this, computeSignature(compiler)); | 711 type = compiler.computeFunctionType(this, computeSignature(compiler)); |
| 712 return type; | 712 return type; |
| 713 } | 713 } |
| 714 | 714 |
| 715 Node parseNode(DiagnosticListener listener) { | 715 Node parseNode(DiagnosticListener listener) { |
| 716 if (cachedNode !== null) return cachedNode; | 716 if (cachedNode !== null) return cachedNode; |
| 717 if (patch === null) { | 717 if (patch === null) { |
| 718 if (modifiers.isExternal()) { | 718 if (modifiers.isExternal()) { |
| 719 // An external function that isn't patched has no body. | 719 listener.cancel("Compiling external function with no implementation.", |
| 720 return null; | 720 element: this); |
| 721 } | 721 } |
| 722 return cachedNode; | 722 return null; |
| 723 } | 723 } |
| 724 cachedNode = patch.parseNode(listener); | 724 cachedNode = patch.parseNode(listener); |
| 725 return cachedNode; | 725 return cachedNode; |
| 726 } | 726 } |
| 727 | 727 |
| 728 Token position() => cachedNode.getBeginToken(); | 728 Token position() => cachedNode.getBeginToken(); |
| 729 | 729 |
| 730 FunctionElement asFunctionElement() => this; | 730 FunctionElement asFunctionElement() => this; |
| 731 } | 731 } |
| 732 | 732 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 final Node node; | 1147 final Node node; |
| 1148 Type bound; | 1148 Type bound; |
| 1149 Type type; | 1149 Type type; |
| 1150 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1150 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1151 [this.bound]) | 1151 [this.bound]) |
| 1152 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1152 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1153 Type computeType(compiler) => type; | 1153 Type computeType(compiler) => type; |
| 1154 Node parseNode(compiler) => node; | 1154 Node parseNode(compiler) => node; |
| 1155 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1155 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1156 } | 1156 } |
| OLD | NEW |