| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class ResolverTask extends CompilerTask { | 5 class ResolverTask extends CompilerTask { |
| 6 Queue<ClassElement> toResolve; | 6 Queue<ClassElement> toResolve; |
| 7 ResolverTask(Compiler compiler) | 7 ResolverTask(Compiler compiler) |
| 8 : super(compiler), toResolve = new Queue<ClassElement>(); | 8 : super(compiler), toResolve = new Queue<ClassElement>(); |
| 9 | 9 |
| 10 String get name() => 'Resolver'; | 10 String get name() => 'Resolver'; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 visit(node.type); | 325 visit(node.type); |
| 326 VariableDefinitionsVisitor visitor = | 326 VariableDefinitionsVisitor visitor = |
| 327 new VariableDefinitionsVisitor(node, this, ElementKind.VARIABLE); | 327 new VariableDefinitionsVisitor(node, this, ElementKind.VARIABLE); |
| 328 visitor.visit(node.definitions); | 328 visitor.visit(node.definitions); |
| 329 } | 329 } |
| 330 | 330 |
| 331 visitWhile(While node) { | 331 visitWhile(While node) { |
| 332 visit(node.condition); | 332 visit(node.condition); |
| 333 visitIn(node.body, new Scope(context)); | 333 visitIn(node.body, new Scope(context)); |
| 334 } | 334 } |
| 335 |
| 336 visitParenthesizedExpression(ParenthesizedExpression node) { |
| 337 visit(node.expression); |
| 338 } |
| 335 } | 339 } |
| 336 | 340 |
| 337 class ClassResolverVisitor extends AbstractVisitor<Type> { | 341 class ClassResolverVisitor extends AbstractVisitor<Type> { |
| 338 Compiler compiler; | 342 Compiler compiler; |
| 339 Scope context; | 343 Scope context; |
| 340 | 344 |
| 341 ClassResolverVisitor(Compiler compiler) | 345 ClassResolverVisitor(Compiler compiler) |
| 342 : this.compiler = compiler, context = new TopScope(compiler.universe); | 346 : this.compiler = compiler, context = new TopScope(compiler.universe); |
| 343 | 347 |
| 344 Type visitClassNode(ClassNode node) { | 348 Type visitClassNode(ClassNode node) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 class TopScope extends Scope { | 476 class TopScope extends Scope { |
| 473 Universe universe; | 477 Universe universe; |
| 474 | 478 |
| 475 TopScope(Universe this.universe) : super.top(); | 479 TopScope(Universe this.universe) : super.top(); |
| 476 Element lookup(SourceString name) => universe.find(name); | 480 Element lookup(SourceString name) => universe.find(name); |
| 477 | 481 |
| 478 Element add(Element element) { | 482 Element add(Element element) { |
| 479 throw "Cannot add an element in the top scope"; | 483 throw "Cannot add an element in the top scope"; |
| 480 } | 484 } |
| 481 } | 485 } |
| OLD | NEW |