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

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

Issue 9109015: AST nodes for function-typed parameters. (Closed) Base URL: ssh://aaricia.aar/home/ahe/Dart/all/dart.googlecode.com.git@master
Patch Set: rebased Created 8 years, 11 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
« no previous file with comments | « no previous file | 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 TreeElements { 5 class TreeElements {
6 Map<Node, Element> map; 6 Map<Node, Element> map;
7 TreeElements() : map = new LinkedHashMap<Node, Element>(); 7 TreeElements() : map = new LinkedHashMap<Node, Element>();
8 operator []=(Node node, Element element) => map[node] = element; 8 operator []=(Node node, Element element) => map[node] = element;
9 operator [](Node node) => map[node]; 9 operator [](Node node) => map[node];
10 } 10 }
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 variables = new VariableListElement.node( 588 variables = new VariableListElement.node(
589 definitions, ElementKind.VARIABLE_LIST, resolver.context.element); 589 definitions, ElementKind.VARIABLE_LIST, resolver.context.element);
590 } 590 }
591 591
592 SourceString visitSendSet(SendSet node) { 592 SourceString visitSendSet(SendSet node) {
593 assert(node.arguments.tail.isEmpty()); // Sanity check 593 assert(node.arguments.tail.isEmpty()); // Sanity check
594 if (node.receiver !== null) { 594 if (node.receiver !== null) {
595 resolver.cancel(node, 595 resolver.cancel(node,
596 "receiver on a variable definition not implemented"); 596 "receiver on a variable definition not implemented");
597 } 597 }
598 Identifier selector = node.selector;
599 resolver.visit(node.arguments.head); 598 resolver.visit(node.arguments.head);
600
601 return visit(node.selector); 599 return visit(node.selector);
602 } 600 }
603 601
604 SourceString visitIdentifier(Identifier node) => node.source; 602 SourceString visitIdentifier(Identifier node) => node.source;
605 603
606 visitNodeList(NodeList node) { 604 visitNodeList(NodeList node) {
607 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { 605 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) {
608 SourceString name = visit(link.head); 606 SourceString name = visit(link.head);
609 Element element = new VariableElement( 607 Element element = new VariableElement(
610 name, variables, kind, resolver.context.element); 608 name, variables, kind, resolver.context.element);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 class TopScope extends Scope { 714 class TopScope extends Scope {
717 Universe universe; 715 Universe universe;
718 716
719 TopScope(Universe this.universe) : super(null, null); 717 TopScope(Universe this.universe) : super(null, null);
720 Element lookup(SourceString name) => universe.find(name); 718 Element lookup(SourceString name) => universe.find(name);
721 719
722 Element add(Element element) { 720 Element add(Element element) {
723 throw "Cannot add an element in the top scope"; 721 throw "Cannot add an element in the top scope";
724 } 722 }
725 } 723 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698