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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 Scanner::Location spread_pos; 1232 Scanner::Location spread_pos;
1233 ExpressionClassifier classifier; 1233 ExpressionClassifier classifier;
1234 ParseArguments(&spread_pos, &classifier, ok); 1234 ParseArguments(&spread_pos, &classifier, ok);
1235 ValidateExpression(&classifier, CHECK_OK); 1235 ValidateExpression(&classifier, CHECK_OK);
1236 1236
1237 DCHECK(!spread_pos.IsValid()); 1237 DCHECK(!spread_pos.IsValid());
1238 1238
1239 return Expression::Default(); 1239 return Expression::Default();
1240 } 1240 }
1241 1241
1242
1243 PreParserExpression PreParser::ParseDoExpression(bool* ok) {
1244 // AssignmentExpression ::
1245 // do '{' StatementList '}'
1246 Expect(Token::DO, CHECK_OK);
1247 Expect(Token::LBRACE, CHECK_OK);
1248 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE);
1249 {
1250 BlockState block_state(&scope_, block_scope);
1251 while (peek() != Token::RBRACE) {
1252 ParseStatementListItem(CHECK_OK);
1253 }
1254 Expect(Token::RBRACE, CHECK_OK);
1255 return PreParserExpression::Default();
1256 }
1257 }
1258
1242 #undef CHECK_OK 1259 #undef CHECK_OK
1243 1260
1244 1261
1245 } // namespace internal 1262 } // namespace internal
1246 } // namespace v8 1263 } // namespace v8
OLDNEW
« 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