OLD | NEW |
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 bool IsJumpStatement() { | 432 bool IsJumpStatement() { |
433 return code_ == kJumpStatement; | 433 return code_ == kJumpStatement; |
434 } | 434 } |
435 | 435 |
436 // Dummy implementation for making statement->somefunc() work in both Parser | 436 // Dummy implementation for making statement->somefunc() work in both Parser |
437 // and PreParser. | 437 // and PreParser. |
438 PreParserStatement* operator->() { return this; } | 438 PreParserStatement* operator->() { return this; } |
439 | 439 |
440 PreParserStatementList statements() { return PreParserStatementList(); } | 440 PreParserStatementList statements() { return PreParserStatementList(); } |
| 441 void set_scope(Scope* scope) {} |
441 | 442 |
442 private: | 443 private: |
443 enum Type { | 444 enum Type { |
444 kUnknownStatement, | 445 kUnknownStatement, |
445 kJumpStatement, | 446 kJumpStatement, |
446 kStringLiteralExpressionStatement, | 447 kStringLiteralExpressionStatement, |
447 kUseStrictExpressionStatement, | 448 kUseStrictExpressionStatement, |
448 kUseAsmExpressionStatement, | 449 kUseAsmExpressionStatement, |
449 kFunctionDeclaration | 450 kFunctionDeclaration |
450 }; | 451 }; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 bool default_export, bool* ok); | 765 bool default_export, bool* ok); |
765 Statement ParseHoistableDeclaration(int pos, ParseFunctionFlags flags, | 766 Statement ParseHoistableDeclaration(int pos, ParseFunctionFlags flags, |
766 ZoneList<const AstRawString*>* names, | 767 ZoneList<const AstRawString*>* names, |
767 bool default_export, bool* ok); | 768 bool default_export, bool* ok); |
768 Statement ParseFunctionDeclaration(bool* ok); | 769 Statement ParseFunctionDeclaration(bool* ok); |
769 Statement ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names, | 770 Statement ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names, |
770 bool default_export, bool* ok); | 771 bool default_export, bool* ok); |
771 Expression ParseAsyncFunctionExpression(bool* ok); | 772 Expression ParseAsyncFunctionExpression(bool* ok); |
772 Statement ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 773 Statement ParseClassDeclaration(ZoneList<const AstRawString*>* names, |
773 bool default_export, bool* ok); | 774 bool default_export, bool* ok); |
774 Statement ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); | |
775 Statement ParseVariableStatement(VariableDeclarationContext var_context, | 775 Statement ParseVariableStatement(VariableDeclarationContext var_context, |
776 ZoneList<const AstRawString*>* names, | 776 ZoneList<const AstRawString*>* names, |
777 bool* ok); | 777 bool* ok); |
778 Statement ParseExpressionOrLabelledStatement( | 778 Statement ParseExpressionOrLabelledStatement( |
779 ZoneList<const AstRawString*>* names, | 779 ZoneList<const AstRawString*>* names, |
780 AllowLabelledFunctionStatement allow_function, bool* ok); | 780 AllowLabelledFunctionStatement allow_function, bool* ok); |
781 Statement ParseIfStatement(ZoneList<const AstRawString*>* labels, bool* ok); | 781 Statement ParseIfStatement(ZoneList<const AstRawString*>* labels, bool* ok); |
782 Statement ParseContinueStatement(bool* ok); | 782 Statement ParseContinueStatement(bool* ok); |
783 Statement ParseBreakStatement(ZoneList<const AstRawString*>* labels, | 783 Statement ParseBreakStatement(ZoneList<const AstRawString*>* labels, |
784 bool* ok); | 784 bool* ok); |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 function_state_->NextMaterializedLiteralIndex(); | 1274 function_state_->NextMaterializedLiteralIndex(); |
1275 function_state_->NextMaterializedLiteralIndex(); | 1275 function_state_->NextMaterializedLiteralIndex(); |
1276 } | 1276 } |
1277 return EmptyExpression(); | 1277 return EmptyExpression(); |
1278 } | 1278 } |
1279 | 1279 |
1280 } // namespace internal | 1280 } // namespace internal |
1281 } // namespace v8 | 1281 } // namespace v8 |
1282 | 1282 |
1283 #endif // V8_PARSING_PREPARSER_H | 1283 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |