Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: dart/frog/leg/resolver.dart

Issue 8660004: Parse parenthesized expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: frogsh Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/frog/frogsh ('k') | dart/frog/leg/scanner/listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « dart/frog/frogsh ('k') | dart/frog/leg/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698