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

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

Issue 9223012: Small changes to get code generation of getters and setters working. Resolution is not fully corr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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 | « frog/leg/namer.dart ('k') | frog/leg/ssa/builder.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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 } 7 }
8 8
9 class TreeElementMapping implements TreeElements { 9 class TreeElementMapping implements TreeElements {
10 Map<Node, Element> map; 10 Map<Node, Element> map;
11 TreeElementMapping() : map = new LinkedHashMap<Node, Element>(); 11 TreeElementMapping() : map = new LinkedHashMap<Node, Element>();
12 operator []=(Node node, Element element) => map[node] = element; 12 operator []=(Node node, Element element) => map[node] = element;
13 operator [](Node node) => map[node]; 13 operator [](Node node) => map[node];
14 } 14 }
15 15
16 class ResolverTask extends CompilerTask { 16 class ResolverTask extends CompilerTask {
17 Queue<ClassElement> toResolve; 17 Queue<ClassElement> toResolve;
18 18
19 ResolverTask(Compiler compiler) 19 ResolverTask(Compiler compiler)
20 : super(compiler), toResolve = new Queue<ClassElement>(); 20 : super(compiler), toResolve = new Queue<ClassElement>();
21 21
22 String get name() => 'Resolver'; 22 String get name() => 'Resolver';
23 23
24 TreeElements resolve(Element element) { 24 TreeElements resolve(Element element) {
25 return measure(() { 25 return measure(() {
26 switch (element.kind) { 26 switch (element.kind) {
27 case ElementKind.GENERATIVE_CONSTRUCTOR: 27 case ElementKind.GENERATIVE_CONSTRUCTOR:
28 case ElementKind.FUNCTION: 28 case ElementKind.FUNCTION:
29 case ElementKind.GETTER:
30 case ElementKind.SETTER:
29 return resolveMethodElement(element); 31 return resolveMethodElement(element);
30 32
31 case ElementKind.FIELD: 33 case ElementKind.FIELD:
32 return resolveFieldElement(element); 34 return resolveFieldElement(element);
33 35
34 default: 36 default:
35 compiler.unimplemented( 37 compiler.unimplemented(
36 "resolver", node: element.parseNode(compiler, compiler)); 38 "resolver", node: element.parseNode(compiler, compiler));
37 } 39 }
38 }); 40 });
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 class TopScope extends Scope { 1004 class TopScope extends Scope {
1003 Universe universe; 1005 Universe universe;
1004 1006
1005 TopScope(Universe this.universe) : super(null, null); 1007 TopScope(Universe this.universe) : super(null, null);
1006 Element lookup(SourceString name) => universe.find(name); 1008 Element lookup(SourceString name) => universe.find(name);
1007 1009
1008 Element add(Element element) { 1010 Element add(Element element) {
1009 throw "Cannot add an element in the top scope"; 1011 throw "Cannot add an element in the top scope";
1010 } 1012 }
1011 } 1013 }
OLDNEW
« no previous file with comments | « frog/leg/namer.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698