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

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: 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') | dart/frog/leg/scanner/listener.dart » ('J')
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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 variables = new VariableListElement.node( 577 variables = new VariableListElement.node(
578 definitions, ElementKind.VARIABLE_LIST, resolver.context.element); 578 definitions, ElementKind.VARIABLE_LIST, resolver.context.element);
579 } 579 }
580 580
581 SourceString visitSendSet(SendSet node) { 581 SourceString visitSendSet(SendSet node) {
582 assert(node.arguments.tail.isEmpty()); // Sanity check 582 assert(node.arguments.tail.isEmpty()); // Sanity check
583 if (node.receiver !== null) { 583 if (node.receiver !== null) {
584 resolver.cancel(node, 584 resolver.cancel(node,
585 "receiver on a variable definition not implemented"); 585 "receiver on a variable definition not implemented");
586 } 586 }
587 Identifier selector = node.selector;
588 resolver.visit(node.arguments.head); 587 resolver.visit(node.arguments.head);
589
590 return visit(node.selector); 588 return visit(node.selector);
591 } 589 }
592 590
593 SourceString visitIdentifier(Identifier node) => node.source; 591 SourceString visitIdentifier(Identifier node) => node.source;
594 592
595 visitNodeList(NodeList node) { 593 visitNodeList(NodeList node) {
596 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { 594 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) {
597 SourceString name = visit(link.head); 595 SourceString name = visit(link.head);
598 Element element = new VariableElement( 596 Element element = new VariableElement(
599 name, variables, kind, resolver.context.element); 597 name, variables, kind, resolver.context.element);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 class TopScope extends Scope { 703 class TopScope extends Scope {
706 Universe universe; 704 Universe universe;
707 705
708 TopScope(Universe this.universe) : super(null, null); 706 TopScope(Universe this.universe) : super(null, null);
709 Element lookup(SourceString name) => universe.find(name); 707 Element lookup(SourceString name) => universe.find(name);
710 708
711 Element add(Element element) { 709 Element add(Element element) {
712 throw "Cannot add an element in the top scope"; 710 throw "Cannot add an element in the top scope";
713 } 711 }
714 } 712 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/scanner/listener.dart » ('j') | dart/frog/leg/scanner/listener.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698