| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool isFunction() => kind === ElementKind.FUNCTION; | 58 bool isFunction() => kind === ElementKind.FUNCTION; |
| 59 bool isMember() => | 59 bool isMember() => |
| 60 enclosingElement !== null && enclosingElement.kind === ElementKind.CLASS; | 60 enclosingElement !== null && enclosingElement.kind === ElementKind.CLASS; |
| 61 bool isInstanceMember() => false; | 61 bool isInstanceMember() => false; |
| 62 bool isFactoryConstructor() => modifiers !== null && modifiers.isFactory(); | 62 bool isFactoryConstructor() => modifiers !== null && modifiers.isFactory(); |
| 63 bool isGenerativeConstructor() => kind === ElementKind.GENERATIVE_CONSTRUCTOR; | 63 bool isGenerativeConstructor() => kind === ElementKind.GENERATIVE_CONSTRUCTOR; |
| 64 bool isCompilationUnit() { | 64 bool isCompilationUnit() { |
| 65 return kind === ElementKind.COMPILATION_UNIT || | 65 return kind === ElementKind.COMPILATION_UNIT || |
| 66 kind === ElementKind.LIBRARY; | 66 kind === ElementKind.LIBRARY; |
| 67 } | 67 } |
| 68 bool isClass() => kind == ElementKind.CLASS; | 68 bool isClass() => kind === ElementKind.CLASS; |
| 69 bool isVariable() => kind === ElementKind.VARIABLE; | 69 bool isVariable() => kind === ElementKind.VARIABLE; |
| 70 bool isParameter() => kind === ElementKind.PARAMETER; | 70 bool isParameter() => kind === ElementKind.PARAMETER; |
| 71 bool isStatement() => kind === ElementKind.STATEMENT; | 71 bool isStatement() => kind === ElementKind.STATEMENT; |
| 72 bool isTypedef() => kind === ElementKind.TYPEDEF; | 72 bool isTypedef() => kind === ElementKind.TYPEDEF; |
| 73 // TODO(ahe): Remove this method. | 73 // TODO(ahe): Remove this method. |
| 74 bool isClassOrInterfaceOrTypedef() { | 74 bool isClassOrInterfaceOrTypedef() { |
| 75 return kind == ElementKind.CLASS || kind == ElementKind.TYPEDEF; | 75 return kind == ElementKind.CLASS || kind == ElementKind.TYPEDEF; |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool isAssignable() { | 78 bool isAssignable() { |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 | 806 |
| 807 LabelElement addLabel(Identifier label, String labelName) { | 807 LabelElement addLabel(Identifier label, String labelName) { |
| 808 LabelElement result = new LabelElement(label, labelName, this, | 808 LabelElement result = new LabelElement(label, labelName, this, |
| 809 enclosingElement); | 809 enclosingElement); |
| 810 labels = labels.prepend(result); | 810 labels = labels.prepend(result); |
| 811 return result; | 811 return result; |
| 812 } | 812 } |
| 813 | 813 |
| 814 Node parseNode(DiagnosticListener l) => statement; | 814 Node parseNode(DiagnosticListener l) => statement; |
| 815 } | 815 } |
| OLD | NEW |