| 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); | 1010 Variable* CreateTempVar(Expression* value = nullptr); |
| 1011 | 1011 |
| 1012 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } | 1012 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } |
| 1013 AstValueFactory* ast_value_factory() const { | 1013 AstValueFactory* ast_value_factory() const { |
| 1014 return descriptor_->parser->ast_value_factory(); | 1014 return descriptor_->parser->ast_value_factory(); |
| 1015 } | 1015 } |
| 1016 bool inside_with() const { return descriptor_->parser->inside_with(); } | 1016 bool inside_with() const { return descriptor_->parser->inside_with(); } |
| 1017 Zone* zone() const { return descriptor_->parser->zone(); } | 1017 Zone* zone() const { return descriptor_->parser->zone(); } |
| 1018 | 1018 |
| 1019 Expression* pattern_; | 1019 Expression* pattern_; |
| 1020 int initializer_position_; | 1020 int initializer_position_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1048 bool* ok); | 1048 bool* ok); |
| 1049 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); | 1049 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); |
| 1050 Statement* ParseThrowStatement(bool* ok); | 1050 Statement* ParseThrowStatement(bool* ok); |
| 1051 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); | 1051 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); |
| 1052 TryStatement* ParseTryStatement(bool* ok); | 1052 TryStatement* ParseTryStatement(bool* ok); |
| 1053 DebuggerStatement* ParseDebuggerStatement(bool* ok); | 1053 DebuggerStatement* ParseDebuggerStatement(bool* ok); |
| 1054 | 1054 |
| 1055 // Support for hamony block scoped bindings. | 1055 // Support for hamony block scoped bindings. |
| 1056 Block* ParseScopedBlock(ZoneList<const AstRawString*>* labels, bool* ok); | 1056 Block* ParseScopedBlock(ZoneList<const AstRawString*>* labels, bool* ok); |
| 1057 | 1057 |
| 1058 // !%_IsSpecObject(result = iterator.next()) && |
| 1059 // %ThrowIteratorResultNotAnObject(result) |
| 1060 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, |
| 1061 int pos); |
| 1062 |
| 1063 |
| 1058 // Initialize the components of a for-in / for-of statement. | 1064 // Initialize the components of a for-in / for-of statement. |
| 1059 void InitializeForEachStatement(ForEachStatement* stmt, | 1065 void InitializeForEachStatement(ForEachStatement* stmt, |
| 1060 Expression* each, | 1066 Expression* each, |
| 1061 Expression* subject, | 1067 Expression* subject, |
| 1062 Statement* body); | 1068 Statement* body); |
| 1063 Statement* DesugarLexicalBindingsInForStatement( | 1069 Statement* DesugarLexicalBindingsInForStatement( |
| 1064 Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names, | 1070 Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names, |
| 1065 ForStatement* loop, Statement* init, Expression* cond, Statement* next, | 1071 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
| 1066 Statement* body, bool* ok); | 1072 Statement* body, bool* ok); |
| 1067 | 1073 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 } | 1271 } |
| 1266 | 1272 |
| 1267 | 1273 |
| 1268 Expression* ParserTraits::SpreadCallNew( | 1274 Expression* ParserTraits::SpreadCallNew( |
| 1269 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1275 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
| 1270 return parser_->SpreadCallNew(function, args, pos); | 1276 return parser_->SpreadCallNew(function, args, pos); |
| 1271 } | 1277 } |
| 1272 } } // namespace v8::internal | 1278 } } // namespace v8::internal |
| 1273 | 1279 |
| 1274 #endif // V8_PARSER_H_ | 1280 #endif // V8_PARSER_H_ |
| OLD | NEW |