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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 bool isGetter() => kind === ElementKind.GETTER; |
73 // TODO(ahe): Remove this method. | 74 // TODO(ahe): Remove this method. |
74 bool isClassOrInterfaceOrTypedef() { | 75 bool isClassOrInterfaceOrTypedef() { |
75 return kind == ElementKind.CLASS || kind == ElementKind.TYPEDEF; | 76 return kind == ElementKind.CLASS || kind == ElementKind.TYPEDEF; |
76 } | 77 } |
77 | 78 |
78 bool isAssignable() { | 79 bool isAssignable() { |
79 if (modifiers != null && modifiers.isFinal()) return false; | 80 if (modifiers != null && modifiers.isFinal()) return false; |
80 if (isFunction() || isGenerativeConstructor()) return false; | 81 if (isFunction() || isGenerativeConstructor()) return false; |
81 return true; | 82 return true; |
82 } | 83 } |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 807 |
807 LabelElement addLabel(Identifier label, String labelName) { | 808 LabelElement addLabel(Identifier label, String labelName) { |
808 LabelElement result = new LabelElement(label, labelName, this, | 809 LabelElement result = new LabelElement(label, labelName, this, |
809 enclosingElement); | 810 enclosingElement); |
810 labels = labels.prepend(result); | 811 labels = labels.prepend(result); |
811 return result; | 812 return result; |
812 } | 813 } |
813 | 814 |
814 Node parseNode(DiagnosticListener l) => statement; | 815 Node parseNode(DiagnosticListener l) => statement; |
815 } | 816 } |
OLD | NEW |