Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: src/parsing/parser.h

Issue 2324783002: Include only stuff you need, part 9: variables.h (Closed)
Patch Set: rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/globals.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/parsing/parser-base.h" 10 #include "src/parsing/parser-base.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // Insert initializer statements for var-bindings shadowing parameter bindings 447 // Insert initializer statements for var-bindings shadowing parameter bindings
448 // from a non-simple parameter list. 448 // from a non-simple parameter list.
449 void InsertShadowingVarBindingInitializers(Block* block); 449 void InsertShadowingVarBindingInitializers(Block* block);
450 450
451 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 451 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3
452 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope, 452 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope,
453 bool* ok); 453 bool* ok);
454 454
455 VariableProxy* NewUnresolved(const AstRawString* name, int begin_pos, 455 VariableProxy* NewUnresolved(const AstRawString* name, int begin_pos,
456 int end_pos = kNoSourcePosition, 456 int end_pos = kNoSourcePosition,
457 Variable::Kind kind = Variable::NORMAL); 457 VariableKind kind = NORMAL_VARIABLE);
458 VariableProxy* NewUnresolved(const AstRawString* name); 458 VariableProxy* NewUnresolved(const AstRawString* name);
459 Variable* Declare(Declaration* declaration, 459 Variable* Declare(Declaration* declaration,
460 DeclarationDescriptor::Kind declaration_kind, 460 DeclarationDescriptor::Kind declaration_kind,
461 VariableMode mode, InitializationFlag init, bool* ok, 461 VariableMode mode, InitializationFlag init, bool* ok,
462 Scope* declaration_scope = nullptr); 462 Scope* declaration_scope = nullptr);
463 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, 463 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
464 int pos, bool* ok); 464 int pos, bool* ok);
465 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, 465 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
466 InitializationFlag init, int pos, bool* ok); 466 InitializationFlag init, int pos, bool* ok);
467 467
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 V8_INLINE const AstRawString* GetNumberAsSymbol() const { 890 V8_INLINE const AstRawString* GetNumberAsSymbol() const {
891 double double_value = scanner()->DoubleValue(); 891 double double_value = scanner()->DoubleValue();
892 char array[100]; 892 char array[100];
893 const char* string = DoubleToCString(double_value, ArrayVector(array)); 893 const char* string = DoubleToCString(double_value, ArrayVector(array));
894 return ast_value_factory()->GetOneByteString(string); 894 return ast_value_factory()->GetOneByteString(string);
895 } 895 }
896 896
897 V8_INLINE Expression* ThisExpression(int pos = kNoSourcePosition) { 897 V8_INLINE Expression* ThisExpression(int pos = kNoSourcePosition) {
898 return NewUnresolved(ast_value_factory()->this_string(), pos, pos + 4, 898 return NewUnresolved(ast_value_factory()->this_string(), pos, pos + 4,
899 Variable::THIS); 899 THIS_VARIABLE);
900 } 900 }
901 901
902 Expression* NewSuperPropertyReference(int pos); 902 Expression* NewSuperPropertyReference(int pos);
903 Expression* NewSuperCallReference(int pos); 903 Expression* NewSuperCallReference(int pos);
904 Expression* NewTargetExpression(int pos); 904 Expression* NewTargetExpression(int pos);
905 Expression* FunctionSentExpression(int pos); 905 Expression* FunctionSentExpression(int pos);
906 906
907 Literal* ExpressionFromLiteral(Token::Value token, int pos); 907 Literal* ExpressionFromLiteral(Token::Value token, int pos);
908 908
909 V8_INLINE Expression* ExpressionFromIdentifier( 909 V8_INLINE Expression* ExpressionFromIdentifier(
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1061
1062 #ifdef DEBUG 1062 #ifdef DEBUG
1063 void Print(AstNode* node); 1063 void Print(AstNode* node);
1064 #endif // DEBUG 1064 #endif // DEBUG
1065 }; 1065 };
1066 1066
1067 } // namespace internal 1067 } // namespace internal
1068 } // namespace v8 1068 } // namespace v8
1069 1069
1070 #endif // V8_PARSING_PARSER_H_ 1070 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698