Chromium Code Reviews| 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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 997 #undef DECLARE_VISIT | 997 #undef DECLARE_VISIT |
| 998 virtual void Visit(AstNode* node) override; | 998 virtual void Visit(AstNode* node) override; |
| 999 | 999 |
| 1000 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) { | 1000 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) { |
| 1001 Expression* old_value = current_value_; | 1001 Expression* old_value = current_value_; |
| 1002 current_value_ = value; | 1002 current_value_ = value; |
| 1003 pattern->Accept(this); | 1003 pattern->Accept(this); |
| 1004 current_value_ = old_value; | 1004 current_value_ = old_value; |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 Variable* CreateTemp(Expression* value); | |
| 1008 | |
| 1007 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } | 1009 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } |
| 1008 AstValueFactory* ast_value_factory() const { | 1010 AstValueFactory* ast_value_factory() const { |
| 1009 return descriptor_->parser->ast_value_factory(); | 1011 return descriptor_->parser->ast_value_factory(); |
| 1010 } | 1012 } |
| 1011 bool inside_with() const { return descriptor_->parser->inside_with(); } | 1013 bool inside_with() const { return descriptor_->parser->inside_with(); } |
| 1012 Zone* zone() const { return descriptor_->parser->zone(); } | 1014 Zone* zone() const { return descriptor_->parser->zone(); } |
| 1015 Scope* TemporaryDeclarationScope() const { | |
|
rossberg
2015/05/18 16:17:19
Nit: is there a strong reason to say "Temporary" h
Dmitry Lomov (no reviews)
2015/05/18 17:31:22
Yes, it is a declaration scope for temporary varia
| |
| 1016 return descriptor_->parser->scope_->DeclarationScope(); | |
| 1017 } | |
| 1013 | 1018 |
| 1014 Expression* pattern_; | 1019 Expression* pattern_; |
| 1015 int initializer_position_; | 1020 int initializer_position_; |
| 1016 Block* block_; | 1021 Block* block_; |
| 1017 const DeclarationDescriptor* descriptor_; | 1022 const DeclarationDescriptor* descriptor_; |
| 1018 ZoneList<const AstRawString*>* names_; | 1023 ZoneList<const AstRawString*>* names_; |
| 1019 Expression* current_value_; | 1024 Expression* current_value_; |
| 1020 bool* ok_; | 1025 bool* ok_; |
| 1021 }; | 1026 }; |
| 1022 | 1027 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1260 } | 1265 } |
| 1261 | 1266 |
| 1262 | 1267 |
| 1263 Expression* ParserTraits::SpreadCallNew( | 1268 Expression* ParserTraits::SpreadCallNew( |
| 1264 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1269 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
| 1265 return parser_->SpreadCallNew(function, args, pos); | 1270 return parser_->SpreadCallNew(function, args, pos); |
| 1266 } | 1271 } |
| 1267 } } // namespace v8::internal | 1272 } } // namespace v8::internal |
| 1268 | 1273 |
| 1269 #endif // V8_PARSER_H_ | 1274 #endif // V8_PARSER_H_ |
| OLD | NEW |