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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 #undef DECLARE_VISIT | 1000 #undef DECLARE_VISIT |
1001 virtual void Visit(AstNode* node) override; | 1001 virtual void Visit(AstNode* node) override; |
1002 | 1002 |
1003 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) { | 1003 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) { |
1004 Expression* old_value = current_value_; | 1004 Expression* old_value = current_value_; |
1005 current_value_ = value; | 1005 current_value_ = value; |
1006 pattern->Accept(this); | 1006 pattern->Accept(this); |
1007 current_value_ = old_value; | 1007 current_value_ = old_value; |
1008 } | 1008 } |
1009 | 1009 |
| 1010 Variable* CreateTempVar(Expression* value); |
| 1011 |
1010 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } | 1012 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } |
1011 AstValueFactory* ast_value_factory() const { | 1013 AstValueFactory* ast_value_factory() const { |
1012 return descriptor_->parser->ast_value_factory(); | 1014 return descriptor_->parser->ast_value_factory(); |
1013 } | 1015 } |
1014 bool inside_with() const { return descriptor_->parser->inside_with(); } | 1016 bool inside_with() const { return descriptor_->parser->inside_with(); } |
1015 Zone* zone() const { return descriptor_->parser->zone(); } | 1017 Zone* zone() const { return descriptor_->parser->zone(); } |
1016 Scope* TemporaryDeclarationScope() const { | |
1017 return descriptor_->parser->scope_->DeclarationScope(); | |
1018 } | |
1019 | 1018 |
1020 Expression* pattern_; | 1019 Expression* pattern_; |
1021 int initializer_position_; | 1020 int initializer_position_; |
1022 Block* block_; | 1021 Block* block_; |
1023 const DeclarationDescriptor* descriptor_; | 1022 const DeclarationDescriptor* descriptor_; |
1024 ZoneList<const AstRawString*>* names_; | 1023 ZoneList<const AstRawString*>* names_; |
1025 Expression* current_value_; | 1024 Expression* current_value_; |
1026 bool* ok_; | 1025 bool* ok_; |
1027 }; | 1026 }; |
1028 | 1027 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 } | 1265 } |
1267 | 1266 |
1268 | 1267 |
1269 Expression* ParserTraits::SpreadCallNew( | 1268 Expression* ParserTraits::SpreadCallNew( |
1270 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1269 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
1271 return parser_->SpreadCallNew(function, args, pos); | 1270 return parser_->SpreadCallNew(function, args, pos); |
1272 } | 1271 } |
1273 } } // namespace v8::internal | 1272 } } // namespace v8::internal |
1274 | 1273 |
1275 #endif // V8_PARSER_H_ | 1274 #endif // V8_PARSER_H_ |
OLD | NEW |