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

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

Issue 1643903003: [generators] Desugar yield*. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refer to ResumeMode Created 4 years, 10 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/messages.h ('k') | src/parsing/parser.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_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
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
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
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_
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698