| 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" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 // function g() { { var x; let x; } } | 1119 // function g() { { var x; let x; } } |
| 1120 // | 1120 // |
| 1121 // The var declarations are hoisted to the function scope, but originate from | 1121 // The var declarations are hoisted to the function scope, but originate from |
| 1122 // a scope where the name has also been let bound or the var declaration is | 1122 // a scope where the name has also been let bound or the var declaration is |
| 1123 // hoisted over such a scope. | 1123 // hoisted over such a scope. |
| 1124 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); | 1124 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); |
| 1125 | 1125 |
| 1126 // Parser support | 1126 // Parser support |
| 1127 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); | 1127 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); |
| 1128 Variable* Declare(Declaration* declaration, | 1128 Variable* Declare(Declaration* declaration, |
| 1129 DeclarationDescriptor::Kind declaration_kind, bool resolve, | 1129 DeclarationDescriptor::Kind declaration_kind, |
| 1130 bool* ok); | 1130 bool report_error, bool* ok); |
| 1131 | 1131 |
| 1132 bool TargetStackContainsLabel(const AstRawString* label); | 1132 bool TargetStackContainsLabel(const AstRawString* label); |
| 1133 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); | 1133 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); |
| 1134 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); | 1134 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); |
| 1135 | 1135 |
| 1136 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos); | 1136 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos); |
| 1137 Statement* BuildAssertIsCoercible(Variable* var); | 1137 Statement* BuildAssertIsCoercible(Variable* var); |
| 1138 | 1138 |
| 1139 // Factory methods. | 1139 // Factory methods. |
| 1140 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos, | 1140 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 auto* init_block = | 1339 auto* init_block = |
| 1340 parser_->BuildParameterInitializationBlock(formal_parameters, ok); | 1340 parser_->BuildParameterInitializationBlock(formal_parameters, ok); |
| 1341 if (!*ok) return; | 1341 if (!*ok) return; |
| 1342 if (init_block != nullptr) { | 1342 if (init_block != nullptr) { |
| 1343 body->Add(init_block, parser_->zone()); | 1343 body->Add(init_block, parser_->zone()); |
| 1344 } | 1344 } |
| 1345 } | 1345 } |
| 1346 } } // namespace v8::internal | 1346 } } // namespace v8::internal |
| 1347 | 1347 |
| 1348 #endif // V8_PARSER_H_ | 1348 #endif // V8_PARSER_H_ |
| OLD | NEW |