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

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

Issue 9657006: Lookup super scope after looking up lexical scope. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | 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 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 class ClassScope extends Scope { 1546 class ClassScope extends Scope {
1547 ClassScope(ClassElement element, LibraryElement library) 1547 ClassScope(ClassElement element, LibraryElement library)
1548 : super(new TopScope(library), element); 1548 : super(new TopScope(library), element);
1549 1549
1550 Element lookup(SourceString name) { 1550 Element lookup(SourceString name) {
1551 ClassElement cls = element; 1551 ClassElement cls = element;
1552 Element element = cls.lookupLocalMember(name); 1552 Element element = cls.lookupLocalMember(name);
1553 if (element != null) return element; 1553 if (element != null) return element;
1554 element = parent.lookup(name); 1554 element = parent.lookup(name);
1555 if (element != null) return element; 1555 if (element != null) return element;
1556 // TODO(ngeoffray): Lookup in the super class. 1556 return cls.lookupSuperMember(name);
1557 return null;
1558 } 1557 }
1559 1558
1560 Element add(Element element) { 1559 Element add(Element element) {
1561 throw "Cannot add an element in a class scope"; 1560 throw "Cannot add an element in a class scope";
1562 } 1561 }
1563 } 1562 }
1564 1563
1565 class TopScope extends Scope { 1564 class TopScope extends Scope {
1566 LibraryElement get library() => element; 1565 LibraryElement get library() => element;
1567 1566
1568 TopScope(LibraryElement library) : super(null, library); 1567 TopScope(LibraryElement library) : super(null, library);
1569 Element lookup(SourceString name) => library.find(name); 1568 Element lookup(SourceString name) => library.find(name);
1570 1569
1571 Element add(Element element) { 1570 Element add(Element element) {
1572 throw "Cannot add an element in the top scope"; 1571 throw "Cannot add an element in the top scope";
1573 } 1572 }
1574 } 1573 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698