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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 // | 788 // |
789 // function f() { { { var x; } let x; } } | 789 // function f() { { { var x; } let x; } } |
790 // function g() { { var x; let x; } } | 790 // function g() { { var x; let x; } } |
791 // | 791 // |
792 // The var declarations are hoisted to the function scope, but originate from | 792 // The var declarations are hoisted to the function scope, but originate from |
793 // a scope where the name has also been let bound or the var declaration is | 793 // a scope where the name has also been let bound or the var declaration is |
794 // hoisted over such a scope. | 794 // hoisted over such a scope. |
795 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); | 795 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); |
796 | 796 |
797 // Parser support | 797 // Parser support |
798 VariableProxy* NewUnresolved(const AstRawString* name, | 798 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); |
799 VariableMode mode, | |
800 Interface* interface); | |
801 void Declare(Declaration* declaration, bool resolve, bool* ok); | 799 void Declare(Declaration* declaration, bool resolve, bool* ok); |
802 | 800 |
803 bool TargetStackContainsLabel(const AstRawString* label); | 801 bool TargetStackContainsLabel(const AstRawString* label); |
804 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); | 802 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); |
805 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); | 803 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); |
806 | 804 |
807 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos); | 805 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos); |
808 | 806 |
809 // Factory methods. | 807 // Factory methods. |
810 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos, | 808 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 } | 944 } |
947 | 945 |
948 | 946 |
949 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 947 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
950 int start, Expression* tag) { | 948 int start, Expression* tag) { |
951 return parser_->CloseTemplateLiteral(state, start, tag); | 949 return parser_->CloseTemplateLiteral(state, start, tag); |
952 } | 950 } |
953 } } // namespace v8::internal | 951 } } // namespace v8::internal |
954 | 952 |
955 #endif // V8_PARSER_H_ | 953 #endif // V8_PARSER_H_ |
OLD | NEW |