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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 FunctionLiteral* ParseFunctionLiteral( | 576 FunctionLiteral* ParseFunctionLiteral( |
577 const AstRawString* name, Scanner::Location function_name_location, | 577 const AstRawString* name, Scanner::Location function_name_location, |
578 bool name_is_strict_reserved, FunctionKind kind, | 578 bool name_is_strict_reserved, FunctionKind kind, |
579 int function_token_position, FunctionLiteral::FunctionType type, | 579 int function_token_position, FunctionLiteral::FunctionType type, |
580 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); | 580 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
581 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, | 581 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, |
582 int* materialized_literal_count, | 582 int* materialized_literal_count, |
583 int* expected_property_count, bool* ok); | 583 int* expected_property_count, bool* ok); |
584 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( | 584 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( |
585 const AstRawString* name, int pos, Variable* fvar, | 585 const AstRawString* name, int pos, Variable* fvar, |
586 Token::Value fvar_init_op, bool is_generator, bool* ok); | 586 Token::Value fvar_init_op, FunctionKind kind, bool* ok); |
587 | 587 |
588 ClassLiteral* ParseClassLiteral(const AstRawString* name, | 588 ClassLiteral* ParseClassLiteral(const AstRawString* name, |
589 Scanner::Location class_name_location, | 589 Scanner::Location class_name_location, |
590 bool name_is_strict_reserved, int pos, | 590 bool name_is_strict_reserved, int pos, |
591 bool* ok); | 591 bool* ok); |
592 | 592 |
593 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, | 593 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
594 bool* ok); | 594 bool* ok); |
595 | 595 |
596 class TemplateLiteral : public ZoneObject { | 596 class TemplateLiteral : public ZoneObject { |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 int* materialized_literal_count, | 864 int* materialized_literal_count, |
865 int* expected_property_count, | 865 int* expected_property_count, |
866 bool* ok); | 866 bool* ok); |
867 | 867 |
868 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( | 868 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( |
869 SingletonLogger* logger); | 869 SingletonLogger* logger); |
870 | 870 |
871 // Consumes the ending }. | 871 // Consumes the ending }. |
872 ZoneList<Statement*>* ParseEagerFunctionBody( | 872 ZoneList<Statement*>* ParseEagerFunctionBody( |
873 const AstRawString* function_name, int pos, Variable* fvar, | 873 const AstRawString* function_name, int pos, Variable* fvar, |
874 Token::Value fvar_init_op, bool is_generator, bool* ok); | 874 Token::Value fvar_init_op, FunctionKind kind, bool* ok); |
875 | 875 |
876 void ThrowPendingError(); | 876 void ThrowPendingError(); |
877 | 877 |
878 TemplateLiteralState OpenTemplateLiteral(int pos); | 878 TemplateLiteralState OpenTemplateLiteral(int pos); |
879 void AddTemplateSpan(TemplateLiteralState* state, bool tail); | 879 void AddTemplateSpan(TemplateLiteralState* state, bool tail); |
880 void AddTemplateExpression(TemplateLiteralState* state, | 880 void AddTemplateExpression(TemplateLiteralState* state, |
881 Expression* expression); | 881 Expression* expression); |
882 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, | 882 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, |
883 Expression* tag); | 883 Expression* tag); |
884 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); | 884 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 int* materialized_literal_count, | 929 int* materialized_literal_count, |
930 int* expected_property_count, | 930 int* expected_property_count, |
931 bool* ok) { | 931 bool* ok) { |
932 return parser_->SkipLazyFunctionBody( | 932 return parser_->SkipLazyFunctionBody( |
933 function_name, materialized_literal_count, expected_property_count, ok); | 933 function_name, materialized_literal_count, expected_property_count, ok); |
934 } | 934 } |
935 | 935 |
936 | 936 |
937 ZoneList<Statement*>* ParserTraits::ParseEagerFunctionBody( | 937 ZoneList<Statement*>* ParserTraits::ParseEagerFunctionBody( |
938 const AstRawString* name, int pos, Variable* fvar, | 938 const AstRawString* name, int pos, Variable* fvar, |
939 Token::Value fvar_init_op, bool is_generator, bool* ok) { | 939 Token::Value fvar_init_op, FunctionKind kind, bool* ok) { |
940 return parser_->ParseEagerFunctionBody(name, pos, fvar, fvar_init_op, | 940 return parser_->ParseEagerFunctionBody(name, pos, fvar, fvar_init_op, kind, |
941 is_generator, ok); | 941 ok); |
942 } | 942 } |
943 | 943 |
944 void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope, | 944 void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
945 bool* ok) { | 945 bool* ok) { |
946 parser_->CheckConflictingVarDeclarations(scope, ok); | 946 parser_->CheckConflictingVarDeclarations(scope, ok); |
947 } | 947 } |
948 | 948 |
949 | 949 |
950 AstValueFactory* ParserTraits::ast_value_factory() { | 950 AstValueFactory* ParserTraits::ast_value_factory() { |
951 return parser_->ast_value_factory(); | 951 return parser_->ast_value_factory(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 } | 997 } |
998 | 998 |
999 | 999 |
1000 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 1000 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
1001 int start, Expression* tag) { | 1001 int start, Expression* tag) { |
1002 return parser_->CloseTemplateLiteral(state, start, tag); | 1002 return parser_->CloseTemplateLiteral(state, start, tag); |
1003 } | 1003 } |
1004 } } // namespace v8::internal | 1004 } } // namespace v8::internal |
1005 | 1005 |
1006 #endif // V8_PARSER_H_ | 1006 #endif // V8_PARSER_H_ |
OLD | NEW |