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

Unified Diff: src/preparser.cc

Issue 1399893002: [es7] implement |do| expressions proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable CrankShaft Created 5 years, 2 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
« src/ast.h ('K') | « src/preparser.h ('k') | src/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index ecf4a950c0ea8e76192e205020de4713bafb5f40..74e11b1d454b3b33a3f6bcadb18f91476a246f37 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -1239,6 +1239,23 @@ PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
return Expression::Default();
}
+
+PreParserExpression PreParser::ParseDoExpression(bool* ok) {
+ // AssignmentExpression ::
+ // do '{' StatementList '}'
+ Expect(Token::DO, CHECK_OK);
+ Expect(Token::LBRACE, CHECK_OK);
+ Scope* block_scope = NewScope(scope_, BLOCK_SCOPE);
+ {
+ BlockState block_state(&scope_, block_scope);
+ while (peek() != Token::RBRACE) {
+ ParseStatementListItem(CHECK_OK);
+ }
+ Expect(Token::RBRACE, CHECK_OK);
+ return PreParserExpression::Default();
+ }
+}
+
#undef CHECK_OK
« src/ast.h ('K') | « src/preparser.h ('k') | src/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698