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_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 void SetFunctionNameFromIdentifierRef(Expression* value, | 651 void SetFunctionNameFromIdentifierRef(Expression* value, |
652 Expression* identifier); | 652 Expression* identifier); |
653 | 653 |
654 // Rewrite expressions that are not used as patterns | 654 // Rewrite expressions that are not used as patterns |
655 V8_INLINE Expression* RewriteNonPattern( | 655 V8_INLINE Expression* RewriteNonPattern( |
656 Expression* expr, const ExpressionClassifier* classifier, bool* ok); | 656 Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
657 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( | 657 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
658 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 658 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
659 bool* ok); | 659 bool* ok); |
660 | 660 |
| 661 Expression* RewriteYieldStar( |
| 662 Expression* generator, Expression* expression, int pos); |
| 663 |
661 private: | 664 private: |
662 Parser* parser_; | 665 Parser* parser_; |
| 666 |
| 667 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator); |
663 }; | 668 }; |
664 | 669 |
665 | 670 |
666 class Parser : public ParserBase<ParserTraits> { | 671 class Parser : public ParserBase<ParserTraits> { |
667 public: | 672 public: |
668 explicit Parser(ParseInfo* info); | 673 explicit Parser(ParseInfo* info); |
669 ~Parser() { | 674 ~Parser() { |
670 delete reusable_preparser_; | 675 delete reusable_preparser_; |
671 reusable_preparser_ = NULL; | 676 reusable_preparser_ = NULL; |
672 delete cached_parse_data_; | 677 delete cached_parse_data_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 754 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, |
750 bool* ok); | 755 bool* ok); |
751 Statement* ParseNativeDeclaration(bool* ok); | 756 Statement* ParseNativeDeclaration(bool* ok); |
752 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); | 757 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); |
753 Block* ParseBlock(ZoneList<const AstRawString*>* labels, | 758 Block* ParseBlock(ZoneList<const AstRawString*>* labels, |
754 bool finalize_block_scope, bool* ok); | 759 bool finalize_block_scope, bool* ok); |
755 Block* ParseVariableStatement(VariableDeclarationContext var_context, | 760 Block* ParseVariableStatement(VariableDeclarationContext var_context, |
756 ZoneList<const AstRawString*>* names, | 761 ZoneList<const AstRawString*>* names, |
757 bool* ok); | 762 bool* ok); |
758 DoExpression* ParseDoExpression(bool* ok); | 763 DoExpression* ParseDoExpression(bool* ok); |
| 764 Expression* ParseYieldStarExpression(bool* ok); |
759 | 765 |
760 struct DeclarationDescriptor { | 766 struct DeclarationDescriptor { |
761 enum Kind { NORMAL, PARAMETER }; | 767 enum Kind { NORMAL, PARAMETER }; |
762 Parser* parser; | 768 Parser* parser; |
763 Scope* scope; | 769 Scope* scope; |
764 Scope* hoist_scope; | 770 Scope* hoist_scope; |
765 VariableMode mode; | 771 VariableMode mode; |
766 bool needs_init; | 772 bool needs_init; |
767 int declaration_pos; | 773 int declaration_pos; |
768 int initialization_pos; | 774 int initialization_pos; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1219 |
1214 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1220 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1215 return parser_->ParseDoExpression(ok); | 1221 return parser_->ParseDoExpression(ok); |
1216 } | 1222 } |
1217 | 1223 |
1218 | 1224 |
1219 } // namespace internal | 1225 } // namespace internal |
1220 } // namespace v8 | 1226 } // namespace v8 |
1221 | 1227 |
1222 #endif // V8_PARSING_PARSER_H_ | 1228 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |