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

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

Issue 9086010: closure calls (just the invocation part). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update test status file. 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 | Annotate | Revision Log
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/tests/leg/src/ClosureCodegenTest.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 TypeCheckerTask extends CompilerTask { 5 class TypeCheckerTask extends CompilerTask {
6 TypeCheckerTask(Compiler compiler) : types = new Types(), super(compiler); 6 TypeCheckerTask(Compiler compiler) : types = new Types(), super(compiler);
7 String get name() => "Type checker"; 7 String get name() => "Type checker";
8 Types types; 8 Types types;
9 9
10 void check(Node tree, TreeElements elements) { 10 void check(Node tree, TreeElements elements) {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 Link<Type> analyzeArguments(Link<Node> arguments) { 300 Link<Type> analyzeArguments(Link<Node> arguments) {
301 LinkBuilder<Type> builder = new LinkBuilder<Type>(); 301 LinkBuilder<Type> builder = new LinkBuilder<Type>();
302 while(!arguments.isEmpty()) { 302 while(!arguments.isEmpty()) {
303 builder.addLast(analyze(arguments.head)); 303 builder.addLast(analyze(arguments.head));
304 arguments = arguments.tail; 304 arguments = arguments.tail;
305 } 305 }
306 return builder.toLink(); 306 return builder.toLink();
307 } 307 }
308 308
309 Type visitSend(Send node) { 309 Type visitSend(Send node) {
310 Identifier selector = node.selector; 310 if (Elements.isClosureSend(node, elements)) {
311 // TODO(karlklose): Finish implementation.
312 return types.dynamicType;
313 }
314
315 Identifier selector = node.selector.asIdentifier();
311 String name = selector.source.stringValue; 316 String name = selector.source.stringValue;
312 317
313 if (node.isOperator) { 318 if (node.isOperator) {
314 final Node firstArgument = node.receiver; 319 final Node firstArgument = node.receiver;
315 final Type firstArgumentType = analyze(node.receiver); 320 final Type firstArgumentType = analyze(node.receiver);
316 final arguments = node.arguments; 321 final arguments = node.arguments;
317 final Node secondArgument = arguments.isEmpty() ? null : arguments.head; 322 final Node secondArgument = arguments.isEmpty() ? null : arguments.head;
318 final Type secondArgumentType = analyzeWithDefault(secondArgument, null); 323 final Type secondArgumentType = analyzeWithDefault(secondArgument, null);
319 324
320 if (name === '+' || name === '=' || name === '-' 325 if (name === '+' || name === '=' || name === '-'
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 } 619 }
615 620
616 visitCatchBlock(CatchBlock node) { 621 visitCatchBlock(CatchBlock node) {
617 compiler.unimplemented('visitCatchBlock', node: node); 622 compiler.unimplemented('visitCatchBlock', node: node);
618 } 623 }
619 624
620 visitTypedef(Typedef node) { 625 visitTypedef(Typedef node) {
621 compiler.unimplemented('visitTypedef', node: node); 626 compiler.unimplemented('visitTypedef', node: node);
622 } 627 }
623 } 628 }
OLDNEW
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/tests/leg/src/ClosureCodegenTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698