| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // Generate AST node that throws a TypeError with the given | 454 // Generate AST node that throws a TypeError with the given |
| 455 // type. Both arguments must be non-null (in the handle sense). | 455 // type. Both arguments must be non-null (in the handle sense). |
| 456 Expression* NewThrowTypeError(MessageTemplate::Template message, | 456 Expression* NewThrowTypeError(MessageTemplate::Template message, |
| 457 const AstRawString* arg, int pos); | 457 const AstRawString* arg, int pos); |
| 458 | 458 |
| 459 // Generic AST generator for throwing errors from compiled code. | 459 // Generic AST generator for throwing errors from compiled code. |
| 460 Expression* NewThrowError(Runtime::FunctionId function_id, | 460 Expression* NewThrowError(Runtime::FunctionId function_id, |
| 461 MessageTemplate::Template message, | 461 MessageTemplate::Template message, |
| 462 const AstRawString* arg, int pos); | 462 const AstRawString* arg, int pos); |
| 463 | 463 |
| 464 void FinalizeForOfStatement(ForOfStatement* loop, int pos); |
| 465 |
| 464 // Reporting errors. | 466 // Reporting errors. |
| 465 void ReportMessageAt(Scanner::Location source_location, | 467 void ReportMessageAt(Scanner::Location source_location, |
| 466 MessageTemplate::Template message, | 468 MessageTemplate::Template message, |
| 467 const char* arg = NULL, | 469 const char* arg = NULL, |
| 468 ParseErrorType error_type = kSyntaxError); | 470 ParseErrorType error_type = kSyntaxError); |
| 469 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, | 471 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, |
| 470 ParseErrorType error_type = kSyntaxError); | 472 ParseErrorType error_type = kSyntaxError); |
| 471 void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, | 473 void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, |
| 472 ParseErrorType error_type = kSyntaxError); | 474 ParseErrorType error_type = kSyntaxError); |
| 473 void ReportMessageAt(Scanner::Location source_location, | 475 void ReportMessageAt(Scanner::Location source_location, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 658 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
| 657 bool* ok); | 659 bool* ok); |
| 658 | 660 |
| 659 Expression* RewriteYieldStar( | 661 Expression* RewriteYieldStar( |
| 660 Expression* generator, Expression* expression, int pos); | 662 Expression* generator, Expression* expression, int pos); |
| 661 | 663 |
| 662 private: | 664 private: |
| 663 Parser* parser_; | 665 Parser* parser_; |
| 664 | 666 |
| 665 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, | 667 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
| 666 Maybe<Variable*> input, Maybe<Variable*> output); | 668 Maybe<Variable*> input, Variable* output); |
| 669 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
| 670 Variable* body_threw); |
| 667 }; | 671 }; |
| 668 | 672 |
| 669 | 673 |
| 670 class Parser : public ParserBase<ParserTraits> { | 674 class Parser : public ParserBase<ParserTraits> { |
| 671 public: | 675 public: |
| 672 explicit Parser(ParseInfo* info); | 676 explicit Parser(ParseInfo* info); |
| 673 ~Parser() { | 677 ~Parser() { |
| 674 delete reusable_preparser_; | 678 delete reusable_preparser_; |
| 675 reusable_preparser_ = NULL; | 679 reusable_preparser_ = NULL; |
| 676 delete cached_parse_data_; | 680 delete cached_parse_data_; |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 | 1224 |
| 1221 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1225 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
| 1222 return parser_->ParseDoExpression(ok); | 1226 return parser_->ParseDoExpression(ok); |
| 1223 } | 1227 } |
| 1224 | 1228 |
| 1225 | 1229 |
| 1226 } // namespace internal | 1230 } // namespace internal |
| 1227 } // namespace v8 | 1231 } // namespace v8 |
| 1228 | 1232 |
| 1229 #endif // V8_PARSING_PARSER_H_ | 1233 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |