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, |
| 668 Maybe<Variable*> input); |
663 }; | 669 }; |
664 | 670 |
665 | 671 |
666 class Parser : public ParserBase<ParserTraits> { | 672 class Parser : public ParserBase<ParserTraits> { |
667 public: | 673 public: |
668 explicit Parser(ParseInfo* info); | 674 explicit Parser(ParseInfo* info); |
669 ~Parser() { | 675 ~Parser() { |
670 delete reusable_preparser_; | 676 delete reusable_preparser_; |
671 reusable_preparser_ = NULL; | 677 reusable_preparser_ = NULL; |
672 delete cached_parse_data_; | 678 delete cached_parse_data_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 755 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, |
750 bool* ok); | 756 bool* ok); |
751 Statement* ParseNativeDeclaration(bool* ok); | 757 Statement* ParseNativeDeclaration(bool* ok); |
752 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); | 758 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); |
753 Block* ParseBlock(ZoneList<const AstRawString*>* labels, | 759 Block* ParseBlock(ZoneList<const AstRawString*>* labels, |
754 bool finalize_block_scope, bool* ok); | 760 bool finalize_block_scope, bool* ok); |
755 Block* ParseVariableStatement(VariableDeclarationContext var_context, | 761 Block* ParseVariableStatement(VariableDeclarationContext var_context, |
756 ZoneList<const AstRawString*>* names, | 762 ZoneList<const AstRawString*>* names, |
757 bool* ok); | 763 bool* ok); |
758 DoExpression* ParseDoExpression(bool* ok); | 764 DoExpression* ParseDoExpression(bool* ok); |
| 765 Expression* ParseYieldStarExpression(bool* ok); |
759 | 766 |
760 struct DeclarationDescriptor { | 767 struct DeclarationDescriptor { |
761 enum Kind { NORMAL, PARAMETER }; | 768 enum Kind { NORMAL, PARAMETER }; |
762 Parser* parser; | 769 Parser* parser; |
763 Scope* scope; | 770 Scope* scope; |
764 Scope* hoist_scope; | 771 Scope* hoist_scope; |
765 VariableMode mode; | 772 VariableMode mode; |
766 bool needs_init; | 773 bool needs_init; |
767 int declaration_pos; | 774 int declaration_pos; |
768 int initialization_pos; | 775 int initialization_pos; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1220 |
1214 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1221 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1215 return parser_->ParseDoExpression(ok); | 1222 return parser_->ParseDoExpression(ok); |
1216 } | 1223 } |
1217 | 1224 |
1218 | 1225 |
1219 } // namespace internal | 1226 } // namespace internal |
1220 } // namespace v8 | 1227 } // namespace v8 |
1221 | 1228 |
1222 #endif // V8_PARSING_PARSER_H_ | 1229 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |