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

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

Issue 9420001: Various mocks and tweaks to reduce cancels in Leg. (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
« no previous file with comments | « dart/frog/leg/lib/mockimpl.dart ('k') | dart/tests/co19/co19-leg.status » ('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) 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 942
943 visitLabelledStatement(LabelledStatement node) { 943 visitLabelledStatement(LabelledStatement node) {
944 String labelName = node.label.source.stringValue; 944 String labelName = node.label.source.stringValue;
945 StatementElement existingElement = statementScope.lookupLabel(labelName); 945 StatementElement existingElement = statementScope.lookupLabel(labelName);
946 if (existingElement !== null) { 946 if (existingElement !== null) {
947 LabelledStatement declaration = existingElement.origin; 947 LabelledStatement declaration = existingElement.origin;
948 warning(node.label, MessageKind.DUPLICATE_LABEL, [labelName]); 948 warning(node.label, MessageKind.DUPLICATE_LABEL, [labelName]);
949 warning(declaration.label, MessageKind.EXISTING_LABEL, [labelName]); 949 warning(declaration.label, MessageKind.EXISTING_LABEL, [labelName]);
950 } 950 }
951 StatementElement element = 951 StatementElement element =
952 new StatementElement.Label(labelName, node, enclosingElement); 952 new StatementElement.label(labelName, node, enclosingElement);
953 statementScope.enterLabelScope(labelName, element); 953 statementScope.enterLabelScope(labelName, element);
954 visit(node.statement); 954 visit(node.statement);
955 statementScope.exitLabelScope(); 955 statementScope.exitLabelScope();
956 if (element.isTarget) { 956 if (element.isTarget) {
957 mapping[node] = element; 957 mapping[node] = element;
958 } else { 958 } else {
959 warning(node.label, MessageKind.UNUSED_LABEL, [labelName]); 959 warning(node.label, MessageKind.UNUSED_LABEL, [labelName]);
960 } 960 }
961 } 961 }
962 962
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 class TopScope extends Scope { 1292 class TopScope extends Scope {
1293 LibraryElement get library() => element; 1293 LibraryElement get library() => element;
1294 1294
1295 TopScope(LibraryElement library) : super(null, library); 1295 TopScope(LibraryElement library) : super(null, library);
1296 Element lookup(SourceString name) => library.find(name); 1296 Element lookup(SourceString name) => library.find(name);
1297 1297
1298 Element add(Element element) { 1298 Element add(Element element) {
1299 throw "Cannot add an element in the top scope"; 1299 throw "Cannot add an element in the top scope";
1300 } 1300 }
1301 } 1301 }
OLDNEW
« no previous file with comments | « dart/frog/leg/lib/mockimpl.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698