| 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 // The var declarations are hoisted to the function scope, but originate from | 1132 // The var declarations are hoisted to the function scope, but originate from |
| 1133 // a scope where the name has also been let bound or the var declaration is | 1133 // a scope where the name has also been let bound or the var declaration is |
| 1134 // hoisted over such a scope. | 1134 // hoisted over such a scope. |
| 1135 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); | 1135 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); |
| 1136 | 1136 |
| 1137 // Insert initializer statements for var-bindings shadowing parameter bindings | 1137 // Insert initializer statements for var-bindings shadowing parameter bindings |
| 1138 // from a non-simple parameter list. | 1138 // from a non-simple parameter list. |
| 1139 void InsertShadowingVarBindingInitializers(Block* block); | 1139 void InsertShadowingVarBindingInitializers(Block* block); |
| 1140 | 1140 |
| 1141 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 | 1141 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 |
| 1142 void InsertSloppyBlockFunctionVarBindings(Scope* scope, bool* ok); | 1142 void InsertSloppyBlockFunctionVarBindings(Scope* scope, ZoneList<Statement*>*
body, bool* ok); |
| 1143 | 1143 |
| 1144 // Parser support | 1144 // Parser support |
| 1145 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); | 1145 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); |
| 1146 Variable* Declare(Declaration* declaration, | 1146 Variable* Declare(Declaration* declaration, |
| 1147 DeclarationDescriptor::Kind declaration_kind, bool resolve, | 1147 DeclarationDescriptor::Kind declaration_kind, bool resolve, |
| 1148 bool* ok, Scope* declaration_scope = nullptr); | 1148 bool* ok, Scope* declaration_scope = nullptr); |
| 1149 | 1149 |
| 1150 bool TargetStackContainsLabel(const AstRawString* label); | 1150 bool TargetStackContainsLabel(const AstRawString* label); |
| 1151 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); | 1151 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); |
| 1152 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); | 1152 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 if (!*ok) return; | 1374 if (!*ok) return; |
| 1375 if (init_block != nullptr) { | 1375 if (init_block != nullptr) { |
| 1376 body->Add(init_block, parser_->zone()); | 1376 body->Add(init_block, parser_->zone()); |
| 1377 } | 1377 } |
| 1378 } | 1378 } |
| 1379 } | 1379 } |
| 1380 } // namespace internal | 1380 } // namespace internal |
| 1381 } // namespace v8 | 1381 } // namespace v8 |
| 1382 | 1382 |
| 1383 #endif // V8_PARSER_H_ | 1383 #endif // V8_PARSER_H_ |
| OLD | NEW |