| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 * Returns the super class, if any. | 608 * Returns the super class, if any. |
| 609 * | 609 * |
| 610 * The returned element may not be resolved yet. | 610 * The returned element may not be resolved yet. |
| 611 */ | 611 */ |
| 612 ClassElement get superclass() { | 612 ClassElement get superclass() { |
| 613 assert(isResolved); | 613 assert(isResolved); |
| 614 return supertype === null ? null : supertype.element; | 614 return supertype === null ? null : supertype.element; |
| 615 } | 615 } |
| 616 | 616 |
| 617 bool isInterface() => false; | 617 bool isInterface() => false; |
| 618 bool isNative() => nativeName != null; |
| 619 String nativeName; |
| 618 } | 620 } |
| 619 | 621 |
| 620 class Elements { | 622 class Elements { |
| 621 static bool isLocal(Element element) { | 623 static bool isLocal(Element element) { |
| 622 return ((element !== null) | 624 return ((element !== null) |
| 623 && !element.isInstanceMember() | 625 && !element.isInstanceMember() |
| 624 && !isStaticOrTopLevelField(element) | 626 && !isStaticOrTopLevelField(element) |
| 625 && !isStaticOrTopLevelFunction(element) | 627 && !isStaticOrTopLevelFunction(element) |
| 626 && (element.kind === ElementKind.VARIABLE || | 628 && (element.kind === ElementKind.VARIABLE || |
| 627 element.kind === ElementKind.PARAMETER || | 629 element.kind === ElementKind.PARAMETER || |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 bool isContinueTarget = false; | 724 bool isContinueTarget = false; |
| 723 | 725 |
| 724 StatementElement(this.origin, Element enclosingElement) | 726 StatementElement(this.origin, Element enclosingElement) |
| 725 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); | 727 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); |
| 726 StatementElement.label(String name, this.origin, Element enclosingElement) | 728 StatementElement.label(String name, this.origin, Element enclosingElement) |
| 727 : super(new SourceString(name), ElementKind.STATEMENT, enclosingElement); | 729 : super(new SourceString(name), ElementKind.STATEMENT, enclosingElement); |
| 728 bool get isTarget() => isBreakTarget || isContinueTarget; | 730 bool get isTarget() => isBreakTarget || isContinueTarget; |
| 729 | 731 |
| 730 Node parseNode(DiagnosticListener l) => origin; | 732 Node parseNode(DiagnosticListener l) => origin; |
| 731 } | 733 } |
| OLD | NEW |