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

Side by Side Diff: src/parsing/preparser.h

Issue 2315733003: Class fields, part 1 (parsing and infrastructure) (Closed)
Patch Set: whitespace Created 4 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 unified diff | Download patch
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_PARSING_PREPARSER_H 5 #ifndef V8_PARSING_PREPARSER_H
6 #define V8_PARSING_PREPARSER_H 6 #define V8_PARSING_PREPARSER_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/parsing/parser-base.h" 9 #include "src/parsing/parser-base.h"
10 10
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 PreParserExpression* operator->() { return this; } 304 PreParserExpression* operator->() { return this; }
305 305
306 // More dummy implementations of things PreParser doesn't need to track: 306 // More dummy implementations of things PreParser doesn't need to track:
307 void set_index(int index) {} // For YieldExpressions 307 void set_index(int index) {} // For YieldExpressions
308 void set_should_eager_compile() {} 308 void set_should_eager_compile() {}
309 void set_should_be_used_once_hint() {} 309 void set_should_be_used_once_hint() {}
310 310
311 int position() const { return kNoSourcePosition; } 311 int position() const { return kNoSourcePosition; }
312 void set_function_token_position(int position) {} 312 void set_function_token_position(int position) {}
313 313
314 void set_is_class_field_initializer(bool is_class_field_initializer) {}
315
314 private: 316 private:
315 enum Type { 317 enum Type {
316 kEmpty, 318 kEmpty,
317 kExpression, 319 kExpression,
318 kIdentifierExpression, 320 kIdentifierExpression,
319 kStringLiteralExpression, 321 kStringLiteralExpression,
320 kBinaryOperationExpression, 322 kBinaryOperationExpression,
321 kSpreadExpression, 323 kSpreadExpression,
322 kObjectLiteralExpression, 324 kObjectLiteralExpression,
323 kArrayLiteralExpression 325 kArrayLiteralExpression
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 public: 460 public:
459 explicit PreParserFactory(void* unused_value_factory) {} 461 explicit PreParserFactory(void* unused_value_factory) {}
460 PreParserExpression NewStringLiteral(PreParserIdentifier identifier, 462 PreParserExpression NewStringLiteral(PreParserIdentifier identifier,
461 int pos) { 463 int pos) {
462 return PreParserExpression::Default(); 464 return PreParserExpression::Default();
463 } 465 }
464 PreParserExpression NewNumberLiteral(double number, 466 PreParserExpression NewNumberLiteral(double number,
465 int pos) { 467 int pos) {
466 return PreParserExpression::Default(); 468 return PreParserExpression::Default();
467 } 469 }
470 PreParserExpression NewUndefinedLiteral(int pos) {
471 return PreParserExpression::Default();
472 }
468 PreParserExpression NewRegExpLiteral(PreParserIdentifier js_pattern, 473 PreParserExpression NewRegExpLiteral(PreParserIdentifier js_pattern,
469 int js_flags, int literal_index, 474 int js_flags, int literal_index,
470 int pos) { 475 int pos) {
471 return PreParserExpression::Default(); 476 return PreParserExpression::Default();
472 } 477 }
473 PreParserExpression NewArrayLiteral(PreParserExpressionList values, 478 PreParserExpression NewArrayLiteral(PreParserExpressionList values,
474 int literal_index, 479 int literal_index,
475 int pos) { 480 int pos) {
476 return PreParserExpression::ArrayLiteral(); 481 return PreParserExpression::ArrayLiteral();
477 } 482 }
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 function_state_->NextMaterializedLiteralIndex(); 1291 function_state_->NextMaterializedLiteralIndex();
1287 function_state_->NextMaterializedLiteralIndex(); 1292 function_state_->NextMaterializedLiteralIndex();
1288 } 1293 }
1289 return EmptyExpression(); 1294 return EmptyExpression();
1290 } 1295 }
1291 1296
1292 } // namespace internal 1297 } // namespace internal
1293 } // namespace v8 1298 } // namespace v8
1294 1299
1295 #endif // V8_PARSING_PREPARSER_H 1300 #endif // V8_PARSING_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698