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_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 Block* block_; | 379 Block* block_; |
380 const DeclarationDescriptor* descriptor_; | 380 const DeclarationDescriptor* descriptor_; |
381 ZoneList<const AstRawString*>* names_; | 381 ZoneList<const AstRawString*>* names_; |
382 Expression* current_value_; | 382 Expression* current_value_; |
383 int recursion_level_; | 383 int recursion_level_; |
384 bool* ok_; | 384 bool* ok_; |
385 | 385 |
386 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() | 386 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() |
387 }; | 387 }; |
388 | 388 |
389 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); | |
390 | |
391 // !%_IsJSReceiver(result = iterator.next()) && | 389 // !%_IsJSReceiver(result = iterator.next()) && |
392 // %ThrowIteratorResultNotAnObject(result) | 390 // %ThrowIteratorResultNotAnObject(result) |
393 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, | 391 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, |
394 int pos); | 392 int pos); |
395 | 393 |
396 Expression* GetIterator(Expression* iterable, int pos); | 394 Expression* GetIterator(Expression* iterable, int pos); |
397 | 395 |
398 // Initialize the components of a for-in / for-of statement. | 396 // Initialize the components of a for-in / for-of statement. |
399 Statement* InitializeForEachStatement(ForEachStatement* stmt, | 397 Statement* InitializeForEachStatement(ForEachStatement* stmt, |
400 Expression* each, Expression* subject, | 398 Expression* each, Expression* subject, |
401 Statement* body, int each_keyword_pos); | 399 Statement* body, int each_keyword_pos); |
402 Statement* InitializeForOfStatement(ForOfStatement* stmt, Expression* each, | 400 Statement* InitializeForOfStatement(ForOfStatement* stmt, Expression* each, |
403 Expression* iterable, Statement* body, | 401 Expression* iterable, Statement* body, |
404 bool finalize, | 402 bool finalize, |
405 int next_result_pos = kNoSourcePosition); | 403 int next_result_pos = kNoSourcePosition); |
| 404 Block* RewriteForVarInLegacy(const ForInfo& for_info); |
| 405 void DesugarBindingInForEachStatement(ForInfo* for_info, Block** body_block, |
| 406 Expression** each_variable, bool* ok); |
| 407 Block* CreateForEachStatementTDZ(Block* init_block, const ForInfo& for_info, |
| 408 bool* ok); |
| 409 |
406 Statement* DesugarLexicalBindingsInForStatement( | 410 Statement* DesugarLexicalBindingsInForStatement( |
407 Scope* inner_scope, VariableMode mode, | 411 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
408 ZoneList<const AstRawString*>* names, ForStatement* loop, Statement* init, | 412 Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok); |
409 Expression* cond, Statement* next, Statement* body, bool* ok); | |
410 | 413 |
411 void DesugarAsyncFunctionBody(Scope* scope, ZoneList<Statement*>* body, | 414 void DesugarAsyncFunctionBody(Scope* scope, ZoneList<Statement*>* body, |
412 FunctionKind kind, FunctionBodyType type, | 415 FunctionKind kind, FunctionBodyType type, |
413 bool accept_IN, int pos, bool* ok); | 416 bool accept_IN, int pos, bool* ok); |
414 | 417 |
415 Expression* RewriteDoExpression(Block* body, int pos, bool* ok); | 418 Expression* RewriteDoExpression(Block* body, int pos, bool* ok); |
416 | 419 |
417 FunctionLiteral* ParseFunctionLiteral( | 420 FunctionLiteral* ParseFunctionLiteral( |
418 const AstRawString* name, Scanner::Location function_name_location, | 421 const AstRawString* name, Scanner::Location function_name_location, |
419 FunctionNameValidity function_name_validity, FunctionKind kind, | 422 FunctionNameValidity function_name_validity, FunctionKind kind, |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 int total_preparse_skipped_; | 1084 int total_preparse_skipped_; |
1082 HistogramTimer* pre_parse_timer_; | 1085 HistogramTimer* pre_parse_timer_; |
1083 | 1086 |
1084 bool parsing_on_main_thread_; | 1087 bool parsing_on_main_thread_; |
1085 }; | 1088 }; |
1086 | 1089 |
1087 } // namespace internal | 1090 } // namespace internal |
1088 } // namespace v8 | 1091 } // namespace v8 |
1089 | 1092 |
1090 #endif // V8_PARSING_PARSER_H_ | 1093 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |