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

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 f22a2c8fac4f1d8b5a0fbf9464119bbccd7ba739..2a121b7102572c38b981a1d206325b3ef35399e0 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_kw, false,
zra 2016/01/12 05:29:39 I'll have to hardcode this flag into the Mojo sour
hausner 2016/01/12 17:49:51 Done that for you, even though I had to break up t
zra 2016/01/12 17:54:22 Thanks =)
+ "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,12 @@ String* Parser::ExpectIdentifier(const char* msg) {
bool Parser::IsAwaitKeyword() {
- return await_is_keyword_ && IsSymbol(Symbols::Await());
+ return (FLAG_await_is_kw || await_is_keyword_) && IsSymbol(Symbols::Await());
}
bool Parser::IsYieldKeyword() {
- return await_is_keyword_ && IsSymbol(Symbols::YieldKw());
+ return (FLAG_await_is_kw ||await_is_keyword_) && IsSymbol(Symbols::YieldKw());
Ivan Posva 2016/01/12 06:14:32 Missing space.
hausner 2016/01/12 17:49:51 Done.
}
« 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