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

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

Issue 9502002: Add FunctionDeclaration node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files. Created 8 years, 9 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/tree/visitors.dart ('k') | tests/co19/co19-leg.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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) : super(compiler); 6 TypeCheckerTask(Compiler compiler) : super(compiler);
7 String get name() => "Type checker"; 7 String get name() => "Type checker";
8 8
9 static final bool LOG_FAILURES = false; 9 static final bool LOG_FAILURES = false;
10 10
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 /** Dart Programming Language Specification: 11.5.1 For Loop */ 266 /** Dart Programming Language Specification: 11.5.1 For Loop */
267 Type visitFor(For node) { 267 Type visitFor(For node) {
268 analyzeWithDefault(node.initializer, StatementType.NOT_RETURNING); 268 analyzeWithDefault(node.initializer, StatementType.NOT_RETURNING);
269 checkCondition(node.condition); 269 checkCondition(node.condition);
270 analyzeWithDefault(node.update, StatementType.NOT_RETURNING); 270 analyzeWithDefault(node.update, StatementType.NOT_RETURNING);
271 StatementType bodyType = analyze(node.body); 271 StatementType bodyType = analyze(node.body);
272 return bodyType.join(StatementType.NOT_RETURNING); 272 return bodyType.join(StatementType.NOT_RETURNING);
273 } 273 }
274 274
275 Type visitFunctionDeclaration(FunctionDeclaration node) {
276 analyze(node.function);
277 return StatementType.NOT_RETURNING;
278 }
279
275 Type visitFunctionExpression(FunctionExpression node) { 280 Type visitFunctionExpression(FunctionExpression node) {
276 Type type; 281 Type type;
277 Type returnType; 282 Type returnType;
278 Type previousType; 283 Type previousType;
279 final FunctionElement element = elements[node]; 284 final FunctionElement element = elements[node];
280 if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR || 285 if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
281 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) { 286 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
282 type = types.dynamicType; 287 type = types.dynamicType;
283 returnType = types.voidType; 288 returnType = types.voidType;
284 } else { 289 } else {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 } 671 }
667 672
668 visitCatchBlock(CatchBlock node) { 673 visitCatchBlock(CatchBlock node) {
669 compiler.unimplemented('visitCatchBlock', node: node); 674 compiler.unimplemented('visitCatchBlock', node: node);
670 } 675 }
671 676
672 visitTypedef(Typedef node) { 677 visitTypedef(Typedef node) {
673 compiler.unimplemented('visitTypedef', node: node); 678 compiler.unimplemented('visitTypedef', node: node);
674 } 679 }
675 } 680 }
OLDNEW
« no previous file with comments | « frog/leg/tree/visitors.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698