| 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/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 const AstRawString* arg, int pos); | 451 const AstRawString* arg, int pos); |
| 452 | 452 |
| 453 // Generic AST generator for throwing errors from compiled code. | 453 // Generic AST generator for throwing errors from compiled code. |
| 454 Expression* NewThrowError(Runtime::FunctionId function_id, | 454 Expression* NewThrowError(Runtime::FunctionId function_id, |
| 455 MessageTemplate::Template message, | 455 MessageTemplate::Template message, |
| 456 const AstRawString* arg, int pos); | 456 const AstRawString* arg, int pos); |
| 457 | 457 |
| 458 void FinalizeIteratorUse(Variable* completion, Expression* condition, | 458 void FinalizeIteratorUse(Variable* completion, Expression* condition, |
| 459 Variable* iter, Block* iterator_use, Block* result); | 459 Variable* iter, Block* iterator_use, Block* result); |
| 460 | 460 |
| 461 Statement* FinalizeForOfStatement(ForOfStatement* loop, int pos); | 461 Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion, |
| 462 int pos); |
| 462 | 463 |
| 463 // Reporting errors. | 464 // Reporting errors. |
| 464 void ReportMessageAt(Scanner::Location source_location, | 465 void ReportMessageAt(Scanner::Location source_location, |
| 465 MessageTemplate::Template message, | 466 MessageTemplate::Template message, |
| 466 const char* arg = NULL, | 467 const char* arg = NULL, |
| 467 ParseErrorType error_type = kSyntaxError); | 468 ParseErrorType error_type = kSyntaxError); |
| 468 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, | 469 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, |
| 469 ParseErrorType error_type = kSyntaxError); | 470 ParseErrorType error_type = kSyntaxError); |
| 470 void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, | 471 void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, |
| 471 ParseErrorType error_type = kSyntaxError); | 472 ParseErrorType error_type = kSyntaxError); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 Statement* ParseScopedStatement(ZoneList<const AstRawString*>* labels, | 957 Statement* ParseScopedStatement(ZoneList<const AstRawString*>* labels, |
| 957 bool legacy, bool* ok); | 958 bool legacy, bool* ok); |
| 958 | 959 |
| 959 // !%_IsJSReceiver(result = iterator.next()) && | 960 // !%_IsJSReceiver(result = iterator.next()) && |
| 960 // %ThrowIteratorResultNotAnObject(result) | 961 // %ThrowIteratorResultNotAnObject(result) |
| 961 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, | 962 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, |
| 962 int pos); | 963 int pos); |
| 963 | 964 |
| 964 | 965 |
| 965 // Initialize the components of a for-in / for-of statement. | 966 // Initialize the components of a for-in / for-of statement. |
| 966 void InitializeForEachStatement(ForEachStatement* stmt, Expression* each, | 967 Statement* InitializeForEachStatement(ForEachStatement* stmt, |
| 967 Expression* subject, Statement* body, | 968 Expression* each, Expression* subject, |
| 968 int each_keyword_pos); | 969 Statement* body, int each_keyword_pos); |
| 969 void InitializeForOfStatement(ForOfStatement* stmt, Expression* each, | 970 Statement* InitializeForOfStatement(ForOfStatement* stmt, Expression* each, |
| 970 Expression* iterable, Statement* body, | 971 Expression* iterable, Statement* body, |
| 971 int next_result_pos = kNoSourcePosition); | 972 bool finalize, |
| 973 int next_result_pos = kNoSourcePosition); |
| 972 Statement* DesugarLexicalBindingsInForStatement( | 974 Statement* DesugarLexicalBindingsInForStatement( |
| 973 Scope* inner_scope, VariableMode mode, | 975 Scope* inner_scope, VariableMode mode, |
| 974 ZoneList<const AstRawString*>* names, ForStatement* loop, Statement* init, | 976 ZoneList<const AstRawString*>* names, ForStatement* loop, Statement* init, |
| 975 Expression* cond, Statement* next, Statement* body, bool* ok); | 977 Expression* cond, Statement* next, Statement* body, bool* ok); |
| 976 | 978 |
| 977 void DesugarAsyncFunctionBody(const AstRawString* function_name, Scope* scope, | 979 void DesugarAsyncFunctionBody(const AstRawString* function_name, Scope* scope, |
| 978 ZoneList<Statement*>* body, | 980 ZoneList<Statement*>* body, |
| 979 Type::ExpressionClassifier* classifier, | 981 Type::ExpressionClassifier* classifier, |
| 980 FunctionKind kind, FunctionBody type, | 982 FunctionKind kind, FunctionBody type, |
| 981 bool accept_IN, int pos, bool* ok); | 983 bool accept_IN, int pos, bool* ok); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 | 1296 |
| 1295 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1297 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
| 1296 return parser_->ParseDoExpression(ok); | 1298 return parser_->ParseDoExpression(ok); |
| 1297 } | 1299 } |
| 1298 | 1300 |
| 1299 | 1301 |
| 1300 } // namespace internal | 1302 } // namespace internal |
| 1301 } // namespace v8 | 1303 } // namespace v8 |
| 1302 | 1304 |
| 1303 #endif // V8_PARSING_PARSER_H_ | 1305 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |