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

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

Issue 9421025: Improve double implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months 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
OLDNEW
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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 } 8 }
9 9
10 class TreeElementMapping implements TreeElements { 10 class TreeElementMapping implements TreeElements {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 class CommonResolverVisitor<R> extends AbstractVisitor<Element> { 366 class CommonResolverVisitor<R> extends AbstractVisitor<Element> {
367 final Compiler compiler; 367 final Compiler compiler;
368 368
369 CommonResolverVisitor(Compiler this.compiler); 369 CommonResolverVisitor(Compiler this.compiler);
370 370
371 R visitNode(Node node) { 371 R visitNode(Node node) {
372 cancel(node, 'internal error'); 372 cancel(node, 'internal error');
373 } 373 }
374 374
375 R visitEmptyStatement(Node node) => null;
376
375 /** Convenience method for visiting nodes that may be null. */ 377 /** Convenience method for visiting nodes that may be null. */
376 R visit(Node node) => (node == null) ? null : node.accept(this); 378 R visit(Node node) => (node == null) ? null : node.accept(this);
377 379
378 void error(Node node, MessageKind kind, [arguments = const []]) { 380 void error(Node node, MessageKind kind, [arguments = const []]) {
379 ResolutionError error = new ResolutionError(kind, arguments); 381 ResolutionError error = new ResolutionError(kind, arguments);
380 compiler.reportError(node, error); 382 compiler.reportError(node, error);
381 } 383 }
382 384
383 void warning(Node node, MessageKind kind, [arguments = const []]) { 385 void warning(Node node, MessageKind kind, [arguments = const []]) {
384 ResolutionWarning warning = new ResolutionWarning(kind, arguments); 386 ResolutionWarning warning = new ResolutionWarning(kind, arguments);
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 class TopScope extends Scope { 1357 class TopScope extends Scope {
1356 LibraryElement get library() => element; 1358 LibraryElement get library() => element;
1357 1359
1358 TopScope(LibraryElement library) : super(null, library); 1360 TopScope(LibraryElement library) : super(null, library);
1359 Element lookup(SourceString name) => library.find(name); 1361 Element lookup(SourceString name) => library.find(name);
1360 1362
1361 Element add(Element element) { 1363 Element add(Element element) {
1362 throw "Cannot add an element in the top scope"; 1364 throw "Cannot add an element in the top scope";
1363 } 1365 }
1364 } 1366 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698