| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart'; | 9 import 'ast.dart'; |
| 10 import 'constant.dart'; | 10 import 'constant.dart'; |
| (...skipping 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3227 variableName.staticElement = element; | 3227 variableName.staticElement = element; |
| 3228 } else { | 3228 } else { |
| 3229 SimpleIdentifier variableName = node.name; | 3229 SimpleIdentifier variableName = node.name; |
| 3230 TopLevelVariableElementImpl variable; | 3230 TopLevelVariableElementImpl variable; |
| 3231 if (isConst && hasInitializer) { | 3231 if (isConst && hasInitializer) { |
| 3232 variable = new ConstTopLevelVariableElementImpl(variableName); | 3232 variable = new ConstTopLevelVariableElementImpl(variableName); |
| 3233 } else { | 3233 } else { |
| 3234 variable = new TopLevelVariableElementImpl.forNode(variableName); | 3234 variable = new TopLevelVariableElementImpl.forNode(variableName); |
| 3235 } | 3235 } |
| 3236 element = variable; | 3236 element = variable; |
| 3237 if (node.parent.parent is TopLevelVariableDeclaration) { |
| 3238 _setDocRange(element, node.parent.parent); |
| 3239 } |
| 3237 if ((node.parent as VariableDeclarationList).type == null) { | 3240 if ((node.parent as VariableDeclarationList).type == null) { |
| 3238 variable.hasImplicitType = true; | 3241 variable.hasImplicitType = true; |
| 3239 } | 3242 } |
| 3240 _currentHolder.addTopLevelVariable(variable); | 3243 _currentHolder.addTopLevelVariable(variable); |
| 3241 variableName.staticElement = element; | 3244 variableName.staticElement = element; |
| 3242 } | 3245 } |
| 3243 element.const3 = isConst; | 3246 element.const3 = isConst; |
| 3244 element.final2 = isFinal; | 3247 element.final2 = isFinal; |
| 3245 if (hasInitializer) { | 3248 if (hasInitializer) { |
| 3246 ElementHolder holder = new ElementHolder(); | 3249 ElementHolder holder = new ElementHolder(); |
| (...skipping 12699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15946 nonFields.add(node); | 15949 nonFields.add(node); |
| 15947 return null; | 15950 return null; |
| 15948 } | 15951 } |
| 15949 | 15952 |
| 15950 @override | 15953 @override |
| 15951 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 15954 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 15952 | 15955 |
| 15953 @override | 15956 @override |
| 15954 Object visitWithClause(WithClause node) => null; | 15957 Object visitWithClause(WithClause node) => null; |
| 15955 } | 15958 } |
| OLD | NEW |