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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 // Rewrite expressions that are not used as patterns | 652 // Rewrite expressions that are not used as patterns |
653 V8_INLINE Expression* RewriteNonPattern( | 653 V8_INLINE Expression* RewriteNonPattern( |
654 Expression* expr, const ExpressionClassifier* classifier, bool* ok); | 654 Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
655 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( | 655 V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
656 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, | 656 ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
657 bool* ok); | 657 bool* ok); |
658 | 658 |
659 Expression* RewriteYieldStar( | 659 Expression* RewriteYieldStar( |
660 Expression* generator, Expression* expression, int pos); | 660 Expression* generator, Expression* expression, int pos); |
661 | 661 |
| 662 Expression* RewriteInstanceof(Expression* lhs, Expression* rhs, int pos); |
| 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, Maybe<Variable*> output); |
| 669 Statement* CheckCallable(Variable* var, Expression* error); |
667 }; | 670 }; |
668 | 671 |
669 | 672 |
670 class Parser : public ParserBase<ParserTraits> { | 673 class Parser : public ParserBase<ParserTraits> { |
671 public: | 674 public: |
672 explicit Parser(ParseInfo* info); | 675 explicit Parser(ParseInfo* info); |
673 ~Parser() { | 676 ~Parser() { |
674 delete reusable_preparser_; | 677 delete reusable_preparser_; |
675 reusable_preparser_ = NULL; | 678 reusable_preparser_ = NULL; |
676 delete cached_parse_data_; | 679 delete cached_parse_data_; |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 | 1223 |
1221 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1224 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1222 return parser_->ParseDoExpression(ok); | 1225 return parser_->ParseDoExpression(ok); |
1223 } | 1226 } |
1224 | 1227 |
1225 | 1228 |
1226 } // namespace internal | 1229 } // namespace internal |
1227 } // namespace v8 | 1230 } // namespace v8 |
1228 | 1231 |
1229 #endif // V8_PARSING_PARSER_H_ | 1232 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |