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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 V8_INLINE const AstRawString* EmptyIdentifierString(); | 542 V8_INLINE const AstRawString* EmptyIdentifierString(); |
543 | 543 |
544 // Odd-ball literal creators. | 544 // Odd-ball literal creators. |
545 Literal* GetLiteralTheHole(int position, AstNodeFactory* factory); | 545 Literal* GetLiteralTheHole(int position, AstNodeFactory* factory); |
546 | 546 |
547 // Producing data during the recursive descent. | 547 // Producing data during the recursive descent. |
548 const AstRawString* GetSymbol(Scanner* scanner); | 548 const AstRawString* GetSymbol(Scanner* scanner); |
549 const AstRawString* GetNextSymbol(Scanner* scanner); | 549 const AstRawString* GetNextSymbol(Scanner* scanner); |
550 const AstRawString* GetNumberAsSymbol(Scanner* scanner); | 550 const AstRawString* GetNumberAsSymbol(Scanner* scanner); |
551 | 551 |
552 Expression* ThisExpression(AstNodeFactory* factory, | 552 Expression* ThisExpression(int pos); |
553 int pos = kNoSourcePosition); | |
554 Expression* NewSuperPropertyReference(AstNodeFactory* factory, int pos); | 553 Expression* NewSuperPropertyReference(AstNodeFactory* factory, int pos); |
555 Expression* NewSuperCallReference(AstNodeFactory* factory, int pos); | 554 Expression* NewSuperCallReference(AstNodeFactory* factory, int pos); |
556 Expression* NewTargetExpression(AstNodeFactory* factory, int pos); | 555 Expression* NewTargetExpression(int pos); |
557 Expression* FunctionSentExpression(AstNodeFactory* factory, int pos); | 556 Expression* FunctionSentExpression(AstNodeFactory* factory, int pos); |
558 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner, | 557 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner, |
559 AstNodeFactory* factory); | 558 AstNodeFactory* factory); |
560 Expression* ExpressionFromIdentifier(const AstRawString* name, | 559 Expression* ExpressionFromIdentifier(const AstRawString* name, |
561 int start_position, int end_position, | 560 int start_position, int end_position); |
562 AstNodeFactory* factory); | |
563 Expression* ExpressionFromString(int pos, Scanner* scanner, | 561 Expression* ExpressionFromString(int pos, Scanner* scanner, |
564 AstNodeFactory* factory); | 562 AstNodeFactory* factory); |
565 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory, | 563 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory, |
566 int pos); | 564 int pos); |
567 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { | 565 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { |
568 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); | 566 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); |
569 } | 567 } |
570 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { | 568 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { |
571 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); | 569 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); |
572 } | 570 } |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 // Insert initializer statements for var-bindings shadowing parameter bindings | 1077 // Insert initializer statements for var-bindings shadowing parameter bindings |
1080 // from a non-simple parameter list. | 1078 // from a non-simple parameter list. |
1081 void InsertShadowingVarBindingInitializers(Block* block); | 1079 void InsertShadowingVarBindingInitializers(Block* block); |
1082 | 1080 |
1083 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 | 1081 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 |
1084 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope, | 1082 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope, |
1085 Scope* complex_params_scope, | 1083 Scope* complex_params_scope, |
1086 bool* ok); | 1084 bool* ok); |
1087 | 1085 |
1088 static InitializationFlag DefaultInitializationFlag(VariableMode mode); | 1086 static InitializationFlag DefaultInitializationFlag(VariableMode mode); |
1089 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); | 1087 VariableProxy* NewUnresolved(const AstRawString* name, int begin_pos, |
| 1088 int end_pos = kNoSourcePosition, |
| 1089 Variable::Kind kind = Variable::NORMAL); |
| 1090 VariableProxy* NewUnresolved(const AstRawString* name); |
1090 Variable* Declare(Declaration* declaration, | 1091 Variable* Declare(Declaration* declaration, |
1091 DeclarationDescriptor::Kind declaration_kind, | 1092 DeclarationDescriptor::Kind declaration_kind, |
1092 VariableMode mode, InitializationFlag init, bool* ok, | 1093 VariableMode mode, InitializationFlag init, bool* ok, |
1093 Scope* declaration_scope = nullptr); | 1094 Scope* declaration_scope = nullptr); |
1094 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, | 1095 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, |
1095 int pos, bool* ok); | 1096 int pos, bool* ok); |
1096 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, | 1097 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, |
1097 InitializationFlag init, int pos, bool* ok); | 1098 InitializationFlag init, int pos, bool* ok); |
1098 | 1099 |
1099 bool TargetStackContainsLabel(const AstRawString* label); | 1100 bool TargetStackContainsLabel(const AstRawString* label); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 | 1374 |
1374 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1375 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1375 return parser_->ParseDoExpression(ok); | 1376 return parser_->ParseDoExpression(ok); |
1376 } | 1377 } |
1377 | 1378 |
1378 | 1379 |
1379 } // namespace internal | 1380 } // namespace internal |
1380 } // namespace v8 | 1381 } // namespace v8 |
1381 | 1382 |
1382 #endif // V8_PARSING_PARSER_H_ | 1383 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |