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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 | 647 |
648 V8_INLINE void QueueDestructuringAssignmentForRewriting( | 648 V8_INLINE void QueueDestructuringAssignmentForRewriting( |
649 Expression* assignment); | 649 Expression* assignment); |
650 | 650 |
651 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 651 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
652 const AstRawString* name); | 652 const AstRawString* name); |
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* RewriteObjectLiteralProperty( | 657 V8_INLINE ZoneList<Expression*>* RewriteNonPatternArguments( |
| 658 ZoneList<Expression*>* args, const ExpressionClassifier* classifier, |
| 659 bool* ok); |
| 660 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
658 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 661 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
659 bool* ok); | 662 bool* ok); |
660 | 663 |
661 private: | 664 private: |
662 Parser* parser_; | 665 Parser* parser_; |
663 }; | 666 }; |
664 | 667 |
665 | 668 |
666 class Parser : public ParserBase<ParserTraits> { | 669 class Parser : public ParserBase<ParserTraits> { |
667 public: | 670 public: |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 Expression* SpreadCallNew(Expression* function, | 1008 Expression* SpreadCallNew(Expression* function, |
1006 ZoneList<v8::internal::Expression*>* args, int pos); | 1009 ZoneList<v8::internal::Expression*>* args, int pos); |
1007 | 1010 |
1008 void SetLanguageMode(Scope* scope, LanguageMode mode); | 1011 void SetLanguageMode(Scope* scope, LanguageMode mode); |
1009 void RaiseLanguageMode(LanguageMode mode); | 1012 void RaiseLanguageMode(LanguageMode mode); |
1010 | 1013 |
1011 V8_INLINE void RewriteDestructuringAssignments(); | 1014 V8_INLINE void RewriteDestructuringAssignments(); |
1012 | 1015 |
1013 V8_INLINE Expression* RewriteNonPattern( | 1016 V8_INLINE Expression* RewriteNonPattern( |
1014 Expression* expr, const ExpressionClassifier* classifier, bool* ok); | 1017 Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
1015 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty( | 1018 V8_INLINE ZoneList<Expression*>* RewriteNonPatternArguments( |
| 1019 ZoneList<Expression*>* args, const ExpressionClassifier* classifier, |
| 1020 bool* ok); |
| 1021 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
1016 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 1022 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
1017 bool* ok); | 1023 bool* ok); |
1018 | 1024 |
1019 friend class InitializerRewriter; | 1025 friend class InitializerRewriter; |
1020 void RewriteParameterInitializer(Expression* expr, Scope* scope); | 1026 void RewriteParameterInitializer(Expression* expr, Scope* scope); |
1021 | 1027 |
1022 Scanner scanner_; | 1028 Scanner scanner_; |
1023 PreParser* reusable_preparser_; | 1029 PreParser* reusable_preparser_; |
1024 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 1030 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
1025 Target* target_stack_; // for break, continue statements | 1031 Target* target_stack_; // for break, continue statements |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 | 1211 |
1206 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1212 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1207 return parser_->ParseDoExpression(ok); | 1213 return parser_->ParseDoExpression(ok); |
1208 } | 1214 } |
1209 | 1215 |
1210 | 1216 |
1211 } // namespace internal | 1217 } // namespace internal |
1212 } // namespace v8 | 1218 } // namespace v8 |
1213 | 1219 |
1214 #endif // V8_PARSING_PARSER_H_ | 1220 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |