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

Unified Diff: runtime/vm/parser.cc

Issue 1573153003: Add flag to make await and yield keywords (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | 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 28777b271e0e835818d86f2bf029a6b8c9c47c75..95dc997b7e0406d3dd0266cd172c2e8317188aed 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -52,6 +52,8 @@ DEFINE_FLAG(bool, conditional_directives, false,
"Enable conditional directives");
DEFINE_FLAG(bool, warn_super, false,
"Warning if super initializer not last in initializer list.");
+DEFINE_FLAG(bool, await_is_keyword, false,
+ "await and yield are treated as proper keywords in synchronous code.");
DECLARE_FLAG(bool, lazy_dispatchers);
DECLARE_FLAG(bool, load_deferred_eagerly);
@@ -10180,12 +10182,14 @@ String* Parser::ExpectIdentifier(const char* msg) {
bool Parser::IsAwaitKeyword() {
- return await_is_keyword_ && IsSymbol(Symbols::Await());
+ return (FLAG_await_is_keyword || await_is_keyword_) &&
+ IsSymbol(Symbols::Await());
}
bool Parser::IsYieldKeyword() {
- return await_is_keyword_ && IsSymbol(Symbols::YieldKw());
+ return (FLAG_await_is_keyword || await_is_keyword_) &&
+ IsSymbol(Symbols::YieldKw());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698