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

Side by Side Diff: pkg/compiler/lib/src/tree/nodes.dart

Issue 962603002: Typecheck return with respect to async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated and tested. Created 5 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 | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/typechecker.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) 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 part of tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 final Node expression; 1059 final Node expression;
1060 final Token beginToken; 1060 final Token beginToken;
1061 final Token endToken; 1061 final Token endToken;
1062 1062
1063 Return(this.beginToken, this.endToken, this.expression); 1063 Return(this.beginToken, this.endToken, this.expression);
1064 1064
1065 Return asReturn() => this; 1065 Return asReturn() => this;
1066 1066
1067 bool get hasExpression => expression != null; 1067 bool get hasExpression => expression != null;
1068 1068
1069 /// `true` if this return is of the form `=> e;`.
1070 bool get isArrowBody => beginToken.info == FUNCTION_INFO;
1071
1069 accept(Visitor visitor) => visitor.visitReturn(this); 1072 accept(Visitor visitor) => visitor.visitReturn(this);
1070 1073
1071 visitChildren(Visitor visitor) { 1074 visitChildren(Visitor visitor) {
1072 if (expression != null) expression.accept(visitor); 1075 if (expression != null) expression.accept(visitor);
1073 } 1076 }
1074 1077
1075 Token getBeginToken() => beginToken; 1078 Token getBeginToken() => beginToken;
1076 1079
1077 Token getEndToken() { 1080 Token getEndToken() {
1078 if (endToken == null) return expression.getEndToken(); 1081 if (endToken == null) return expression.getEndToken();
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 2297
2295 // VariableDefinitions. 2298 // VariableDefinitions.
2296 get metadata => null; 2299 get metadata => null;
2297 get type => null; 2300 get type => null;
2298 2301
2299 // Typedef. 2302 // Typedef.
2300 get typeParameters => null; 2303 get typeParameters => null;
2301 get formals => null; 2304 get formals => null;
2302 get typedefKeyword => null; 2305 get typedefKeyword => null;
2303 } 2306 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698