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

Unified Diff: runtime/vm/parser.cc

Issue 537623002: Enable await in more statements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/await_future_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 5025fdfc6fabef6758fef0301dcffa75ab995a38..df809933fb29b88cdc6bef336afc2f477557381c 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -6697,7 +6697,7 @@ AstNode* Parser::ParseIfStatement(String* label_name) {
}
ConsumeToken();
ExpectToken(Token::kLPAREN);
- AstNode* cond_expr = ParseExpr(kAllowConst, kConsumeCascades);
+ AstNode* cond_expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades);
ExpectToken(Token::kRPAREN);
const bool parsing_loop_body = false;
SequenceNode* true_branch = ParseNestedStatement(parsing_loop_body, NULL);
@@ -6870,7 +6870,7 @@ AstNode* Parser::ParseSwitchStatement(String* label_name) {
ConsumeToken();
ExpectToken(Token::kLPAREN);
const intptr_t expr_pos = TokenPos();
- AstNode* switch_expr = ParseExpr(kAllowConst, kConsumeCascades);
+ AstNode* switch_expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades);
ExpectToken(Token::kRPAREN);
ExpectToken(Token::kLBRACE);
OpenBlock();
@@ -7849,7 +7849,7 @@ AstNode* Parser::ParseStatement() {
ReportError(return_pos,
"return of a value not allowed in constructors");
}
- AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades);
+ AstNode* expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades);
statement = new(I) ReturnNode(statement_pos, expr);
} else {
statement = new(I) ReturnNode(statement_pos);
« no previous file with comments | « no previous file | tests/language/await_future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698