| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // TODO(johnniwinther): This breaks for libraries (for which enclosing | 163 // TODO(johnniwinther): This breaks for libraries (for which enclosing |
| 164 // elements are null) and is invalid for top level variable declarations for | 164 // elements are null) and is invalid for top level variable declarations for |
| 165 // which the enclosing element is a VariableDeclarations and not a compilation | 165 // which the enclosing element is a VariableDeclarations and not a compilation |
| 166 // unit. | 166 // unit. |
| 167 bool isTopLevel() { | 167 bool isTopLevel() { |
| 168 return enclosingElement !== null && enclosingElement.isCompilationUnit(); | 168 return enclosingElement !== null && enclosingElement.isCompilationUnit(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool isAssignable() { | 171 bool isAssignable() { |
| 172 if (modifiers != null && modifiers.isFinal()) return false; | 172 if (modifiers != null && modifiers.isFinalOrConst()) return false; |
| 173 if (isFunction() || isGenerativeConstructor()) return false; | 173 if (isFunction() || isGenerativeConstructor()) return false; |
| 174 return true; | 174 return true; |
| 175 } | 175 } |
| 176 | 176 |
| 177 Token position() => null; | 177 Token position() => null; |
| 178 | 178 |
| 179 Token findMyName(Token token) { | 179 Token findMyName(Token token) { |
| 180 for (Token t = token; t.kind !== EOF_TOKEN; t = t.next) { | 180 for (Token t = token; t.kind !== EOF_TOKEN; t = t.next) { |
| 181 if (t.value == name) return t; | 181 if (t.value == name) return t; |
| 182 } | 182 } |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 Node parseNode(compiler) => cachedNode; | 1479 Node parseNode(compiler) => cachedNode; |
| 1480 | 1480 |
| 1481 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1481 String toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1482 | 1482 |
| 1483 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { | 1483 TypeVariableElement cloneTo(Element enclosing, DiagnosticListener listener) { |
| 1484 TypeVariableElement result = | 1484 TypeVariableElement result = |
| 1485 new TypeVariableElement(name, enclosing, node, type, bound); | 1485 new TypeVariableElement(name, enclosing, node, type, bound); |
| 1486 return result; | 1486 return result; |
| 1487 } | 1487 } |
| 1488 } | 1488 } |
| OLD | NEW |