| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 646 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
| 647 const AstRawString* name); | 647 const AstRawString* name); |
| 648 | 648 |
| 649 void SetFunctionNameFromIdentifierRef(Expression* value, | 649 void SetFunctionNameFromIdentifierRef(Expression* value, |
| 650 Expression* identifier); | 650 Expression* identifier); |
| 651 | 651 |
| 652 // Rewrite expressions that are not used as patterns | 652 // Rewrite expressions that are not used as patterns |
| 653 V8_INLINE Expression* RewriteNonPattern( | 653 V8_INLINE Expression* RewriteNonPattern( |
| 654 Expression* expr, const ExpressionClassifier* classifier, bool* ok); | 654 Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
| 655 V8_INLINE ZoneList<Expression*>* RewriteNonPatternArguments( | |
| 656 ZoneList<Expression*>* args, const ExpressionClassifier* classifier, | |
| 657 bool* ok); | |
| 658 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( | 655 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
| 659 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 656 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
| 660 bool* ok); | 657 bool* ok); |
| 661 | 658 |
| 662 private: | 659 private: |
| 663 Parser* parser_; | 660 Parser* parser_; |
| 664 }; | 661 }; |
| 665 | 662 |
| 666 | 663 |
| 667 class Parser : public ParserBase<ParserTraits> { | 664 class Parser : public ParserBase<ParserTraits> { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 void SetLanguageMode(Scope* scope, LanguageMode mode); | 1011 void SetLanguageMode(Scope* scope, LanguageMode mode); |
| 1015 void RaiseLanguageMode(LanguageMode mode); | 1012 void RaiseLanguageMode(LanguageMode mode); |
| 1016 | 1013 |
| 1017 V8_INLINE void RewriteDestructuringAssignments(); | 1014 V8_INLINE void RewriteDestructuringAssignments(); |
| 1018 | 1015 |
| 1019 friend class NonPatternRewriter; | 1016 friend class NonPatternRewriter; |
| 1020 V8_INLINE Expression* RewriteSpreads(ArrayLiteral* lit); | 1017 V8_INLINE Expression* RewriteSpreads(ArrayLiteral* lit); |
| 1021 | 1018 |
| 1022 V8_INLINE Expression* RewriteNonPattern( | 1019 V8_INLINE Expression* RewriteNonPattern( |
| 1023 Expression* expr, const ExpressionClassifier* classifier, bool* ok); | 1020 Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
| 1024 V8_INLINE ZoneList<Expression*>* RewriteNonPatternArguments( | |
| 1025 ZoneList<Expression*>* args, const ExpressionClassifier* classifier, | |
| 1026 bool* ok); | |
| 1027 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( | 1021 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
| 1028 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 1022 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
| 1029 bool* ok); | 1023 bool* ok); |
| 1030 | 1024 |
| 1031 friend class InitializerRewriter; | 1025 friend class InitializerRewriter; |
| 1032 void RewriteParameterInitializer(Expression* expr, Scope* scope); | 1026 void RewriteParameterInitializer(Expression* expr, Scope* scope); |
| 1033 | 1027 |
| 1034 Scanner scanner_; | 1028 Scanner scanner_; |
| 1035 PreParser* reusable_preparser_; | 1029 PreParser* reusable_preparser_; |
| 1036 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 1030 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 | 1211 |
| 1218 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1212 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
| 1219 return parser_->ParseDoExpression(ok); | 1213 return parser_->ParseDoExpression(ok); |
| 1220 } | 1214 } |
| 1221 | 1215 |
| 1222 | 1216 |
| 1223 } // namespace internal | 1217 } // namespace internal |
| 1224 } // namespace v8 | 1218 } // namespace v8 |
| 1225 | 1219 |
| 1226 #endif // V8_PARSING_PARSER_H_ | 1220 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |