| 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
| 6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 | 566 |
| 567 // Utility functions | 567 // Utility functions |
| 568 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, | 568 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, |
| 569 Scanner::Location* dupe_loc, | 569 Scanner::Location* dupe_loc, |
| 570 bool* ok); | 570 bool* ok); |
| 571 V8_INLINE AstValueFactory* ast_value_factory(); | 571 V8_INLINE AstValueFactory* ast_value_factory(); |
| 572 | 572 |
| 573 // Temporary glue; these functions will move to ParserBase. | 573 // Temporary glue; these functions will move to ParserBase. |
| 574 Expression* ParseV8Intrinsic(bool* ok); | 574 Expression* ParseV8Intrinsic(bool* ok); |
| 575 FunctionLiteral* ParseFunctionLiteral( | 575 FunctionLiteral* ParseFunctionLiteral( |
| 576 const AstRawString* name, | 576 const AstRawString* name, Scanner::Location function_name_location, |
| 577 Scanner::Location function_name_location, | 577 bool name_is_strict_reserved, FunctionKind kind, |
| 578 bool name_is_strict_reserved, | 578 int function_token_position, FunctionLiteral::FunctionType type, |
| 579 bool is_generator, | 579 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 580 int function_token_position, | |
| 581 FunctionLiteral::FunctionType type, | |
| 582 FunctionLiteral::ArityRestriction arity_restriction, | |
| 583 bool* ok); | |
| 584 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, | 580 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, |
| 585 int* materialized_literal_count, | 581 int* materialized_literal_count, |
| 586 int* expected_property_count, bool* ok); | 582 int* expected_property_count, bool* ok); |
| 587 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( | 583 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( |
| 588 const AstRawString* name, int pos, Variable* fvar, | 584 const AstRawString* name, int pos, Variable* fvar, |
| 589 Token::Value fvar_init_op, bool is_generator, bool* ok); | 585 Token::Value fvar_init_op, bool is_generator, bool* ok); |
| 590 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, | 586 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
| 591 bool* ok); | 587 bool* ok); |
| 592 | 588 |
| 593 private: | 589 private: |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 void InitializeForEachStatement(ForEachStatement* stmt, | 723 void InitializeForEachStatement(ForEachStatement* stmt, |
| 728 Expression* each, | 724 Expression* each, |
| 729 Expression* subject, | 725 Expression* subject, |
| 730 Statement* body); | 726 Statement* body); |
| 731 Statement* DesugarLetBindingsInForStatement( | 727 Statement* DesugarLetBindingsInForStatement( |
| 732 Scope* inner_scope, ZoneList<const AstRawString*>* names, | 728 Scope* inner_scope, ZoneList<const AstRawString*>* names, |
| 733 ForStatement* loop, Statement* init, Expression* cond, Statement* next, | 729 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
| 734 Statement* body, bool* ok); | 730 Statement* body, bool* ok); |
| 735 | 731 |
| 736 FunctionLiteral* ParseFunctionLiteral( | 732 FunctionLiteral* ParseFunctionLiteral( |
| 737 const AstRawString* name, | 733 const AstRawString* name, Scanner::Location function_name_location, |
| 738 Scanner::Location function_name_location, | 734 bool name_is_strict_reserved, FunctionKind kind, |
| 739 bool name_is_strict_reserved, | 735 int function_token_position, FunctionLiteral::FunctionType type, |
| 740 bool is_generator, | 736 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 741 int function_token_position, | |
| 742 FunctionLiteral::FunctionType type, | |
| 743 FunctionLiteral::ArityRestriction arity_restriction, | |
| 744 bool* ok); | |
| 745 | 737 |
| 746 // Magical syntax support. | 738 // Magical syntax support. |
| 747 Expression* ParseV8Intrinsic(bool* ok); | 739 Expression* ParseV8Intrinsic(bool* ok); |
| 748 | 740 |
| 749 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); | 741 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); |
| 750 | 742 |
| 751 // Get odd-ball literals. | 743 // Get odd-ball literals. |
| 752 Literal* GetLiteralUndefined(int position); | 744 Literal* GetLiteralUndefined(int position); |
| 753 | 745 |
| 754 // For harmony block scoping mode: Check if the scope has conflicting var/let | 746 // For harmony block scoping mode: Check if the scope has conflicting var/let |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 private: | 883 private: |
| 892 static const int kLiteralTypeSlot = 0; | 884 static const int kLiteralTypeSlot = 0; |
| 893 static const int kElementsSlot = 1; | 885 static const int kElementsSlot = 1; |
| 894 | 886 |
| 895 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 887 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 896 }; | 888 }; |
| 897 | 889 |
| 898 } } // namespace v8::internal | 890 } } // namespace v8::internal |
| 899 | 891 |
| 900 #endif // V8_PARSER_H_ | 892 #endif // V8_PARSER_H_ |
| OLD | NEW |