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

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: Address comment. 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
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 print(new Unparser(true).unparse(node));
312 print(node.receiver);
313 print(node.selector);
ngeoffray 2012/01/05 14:05:46 Remove debugging code.
floitsch 2012/01/24 13:28:37 Done.
314 // TODO(karlklose): Finish implementation.
315 return types.dynamicType;
316 }
317
318 Identifier selector = node.selector.asIdentifier();
311 String name = selector.source.stringValue; 319 String name = selector.source.stringValue;
312 320
313 if (node.isOperator) { 321 if (node.isOperator) {
314 final Node firstArgument = node.receiver; 322 final Node firstArgument = node.receiver;
315 final Type firstArgumentType = analyze(node.receiver); 323 final Type firstArgumentType = analyze(node.receiver);
316 final arguments = node.arguments; 324 final arguments = node.arguments;
317 final Node secondArgument = arguments.isEmpty() ? null : arguments.head; 325 final Node secondArgument = arguments.isEmpty() ? null : arguments.head;
318 final Type secondArgumentType = analyzeWithDefault(secondArgument, null); 326 final Type secondArgumentType = analyzeWithDefault(secondArgument, null);
319 327
320 if (name === '+' || name === '=' || name === '-' 328 if (name === '+' || name === '=' || name === '-'
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 } 622 }
615 623
616 visitCatchBlock(CatchBlock node) { 624 visitCatchBlock(CatchBlock node) {
617 compiler.unimplemented('visitCatchBlock', node: node); 625 compiler.unimplemented('visitCatchBlock', node: node);
618 } 626 }
619 627
620 visitTypedef(Typedef node) { 628 visitTypedef(Typedef node) {
621 compiler.unimplemented('visitTypedef', node: node); 629 compiler.unimplemented('visitTypedef', node: node);
622 } 630 }
623 } 631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698