| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 if (identifier === null) { | 320 if (identifier === null) { |
| 321 compiler.cancel('library prefixes not handled', | 321 compiler.cancel('library prefixes not handled', |
| 322 node: typeAnnotation.typeName); | 322 node: typeAnnotation.typeName); |
| 323 } | 323 } |
| 324 final SourceString name = identifier.source; | 324 final SourceString name = identifier.source; |
| 325 Element element = library.find(name); | 325 Element element = library.find(name); |
| 326 if (element !== null && element.kind === ElementKind.CLASS) { | 326 if (element !== null && element.kind === ElementKind.CLASS) { |
| 327 // TODO(karlklose): substitute type parameters. | 327 // TODO(karlklose): substitute type parameters. |
| 328 return element.computeType(compiler); | 328 return element.computeType(compiler); |
| 329 } | 329 } |
| 330 return compiler.types.lookup(name); | 330 Type type = compiler.types.lookup(name); |
| 331 if (type === null) { |
| 332 type = compiler.types.dynamicType; |
| 333 } |
| 334 return type; |
| 331 } | 335 } |
| 332 | 336 |
| 333 class FunctionParameters { | 337 class FunctionParameters { |
| 334 Link<Element> requiredParameters; | 338 Link<Element> requiredParameters; |
| 335 Link<Element> optionalParameters; | 339 Link<Element> optionalParameters; |
| 336 int requiredParameterCount; | 340 int requiredParameterCount; |
| 337 int optionalParameterCount; | 341 int optionalParameterCount; |
| 338 FunctionParameters(this.requiredParameters, | 342 FunctionParameters(this.requiredParameters, |
| 339 this.optionalParameters, | 343 this.optionalParameters, |
| 340 this.requiredParameterCount, | 344 this.requiredParameterCount, |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 bool isContinueTarget = false; | 719 bool isContinueTarget = false; |
| 716 | 720 |
| 717 StatementElement(this.origin, Element enclosingElement) | 721 StatementElement(this.origin, Element enclosingElement) |
| 718 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); | 722 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); |
| 719 StatementElement.label(String name, this.origin, Element enclosingElement) | 723 StatementElement.label(String name, this.origin, Element enclosingElement) |
| 720 : super(new SourceString(name), ElementKind.STATEMENT, enclosingElement); | 724 : super(new SourceString(name), ElementKind.STATEMENT, enclosingElement); |
| 721 bool get isTarget() => isBreakTarget || isContinueTarget; | 725 bool get isTarget() => isBreakTarget || isContinueTarget; |
| 722 | 726 |
| 723 Node parseNode(DiagnosticListener l) => origin; | 727 Node parseNode(DiagnosticListener l) => origin; |
| 724 } | 728 } |
| OLD | NEW |