| 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('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 // TODO(johnniwinther): This breaks for libraries (for which enclosing | 166 // TODO(johnniwinther): This breaks for libraries (for which enclosing |
| 167 // elements are null) and is invalid for top level variable declarations for | 167 // elements are null) and is invalid for top level variable declarations for |
| 168 // which the enclosing element is a VariableDeclarations and not a compilation | 168 // which the enclosing element is a VariableDeclarations and not a compilation |
| 169 // unit. | 169 // unit. |
| 170 bool isTopLevel() { | 170 bool isTopLevel() { |
| 171 return enclosingElement !== null && enclosingElement.isCompilationUnit(); | 171 return enclosingElement !== null && enclosingElement.isCompilationUnit(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool isAssignable() { | 174 bool isAssignable() { |
| 175 if (modifiers != null && modifiers.isFinal()) return false; | 175 if (modifiers != null && modifiers.isFinalOrConst()) return false; |
| 176 if (isFunction() || isGenerativeConstructor()) return false; | 176 if (isFunction() || isGenerativeConstructor()) return false; |
| 177 return true; | 177 return true; |
| 178 } | 178 } |
| 179 | 179 |
| 180 Token position() => null; | 180 Token position() => null; |
| 181 | 181 |
| 182 Token findMyName(Token token) { | 182 Token findMyName(Token token) { |
| 183 for (Token t = token; t.kind !== EOF_TOKEN; t = t.next) { | 183 for (Token t = token; t.kind !== EOF_TOKEN; t = t.next) { |
| 184 if (t.value == name) return t; | 184 if (t.value == name) return t; |
| 185 } | 185 } |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 */ | 1609 */ |
| 1610 class MetadataAnnotation { | 1610 class MetadataAnnotation { |
| 1611 /** | 1611 /** |
| 1612 * The compile-time constant which this annotation resolves to. | 1612 * The compile-time constant which this annotation resolves to. |
| 1613 * In the mirror system, this would be an object mirror. | 1613 * In the mirror system, this would be an object mirror. |
| 1614 */ | 1614 */ |
| 1615 abstract Constant get value(); | 1615 abstract Constant get value(); |
| 1616 | 1616 |
| 1617 // TODO(ahe): Add more functionality as needed. | 1617 // TODO(ahe): Add more functionality as needed. |
| 1618 } | 1618 } |
| OLD | NEW |