| 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 #include "src/ast/prettyprinter.h" | 5 #include "src/ast/prettyprinter.h" |
| 6 | 6 |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 | 8 |
| 9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 | 414 |
| 415 void CallPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) {} | 415 void CallPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) {} |
| 416 | 416 |
| 417 | 417 |
| 418 void CallPrinter::VisitSuperCallReference(SuperCallReference* node) { | 418 void CallPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 419 Print("super"); | 419 Print("super"); |
| 420 } | 420 } |
| 421 | 421 |
| 422 | 422 |
| 423 void CallPrinter::VisitRewritableAssignmentExpression( |
| 424 RewritableAssignmentExpression* node) { |
| 425 Find(node->expression()); |
| 426 } |
| 427 |
| 428 |
| 423 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { | 429 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { |
| 424 if (statements == NULL) return; | 430 if (statements == NULL) return; |
| 425 for (int i = 0; i < statements->length(); i++) { | 431 for (int i = 0; i < statements->length(); i++) { |
| 426 Find(statements->at(i)); | 432 Find(statements->at(i)); |
| 427 } | 433 } |
| 428 } | 434 } |
| 429 | 435 |
| 430 | 436 |
| 431 void CallPrinter::FindArguments(ZoneList<Expression*>* arguments) { | 437 void CallPrinter::FindArguments(ZoneList<Expression*>* arguments) { |
| 432 if (found_) return; | 438 if (found_) return; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 void PrettyPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { | 930 void PrettyPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { |
| 925 Print("<super-property-reference>"); | 931 Print("<super-property-reference>"); |
| 926 } | 932 } |
| 927 | 933 |
| 928 | 934 |
| 929 void PrettyPrinter::VisitSuperCallReference(SuperCallReference* node) { | 935 void PrettyPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 930 Print("<super-call-reference>"); | 936 Print("<super-call-reference>"); |
| 931 } | 937 } |
| 932 | 938 |
| 933 | 939 |
| 940 void PrettyPrinter::VisitRewritableAssignmentExpression( |
| 941 RewritableAssignmentExpression* node) { |
| 942 Visit(node->expression()); |
| 943 } |
| 944 |
| 945 |
| 934 const char* PrettyPrinter::Print(AstNode* node) { | 946 const char* PrettyPrinter::Print(AstNode* node) { |
| 935 Init(); | 947 Init(); |
| 936 Visit(node); | 948 Visit(node); |
| 937 return output_; | 949 return output_; |
| 938 } | 950 } |
| 939 | 951 |
| 940 | 952 |
| 941 const char* PrettyPrinter::PrintExpression(FunctionLiteral* program) { | 953 const char* PrettyPrinter::PrintExpression(FunctionLiteral* program) { |
| 942 Init(); | 954 Init(); |
| 943 ExpressionStatement* statement = | 955 ExpressionStatement* statement = |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 void AstPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { | 1687 void AstPrinter::VisitSuperPropertyReference(SuperPropertyReference* node) { |
| 1676 IndentedScope indent(this, "SUPER-PROPERTY-REFERENCE", node->position()); | 1688 IndentedScope indent(this, "SUPER-PROPERTY-REFERENCE", node->position()); |
| 1677 } | 1689 } |
| 1678 | 1690 |
| 1679 | 1691 |
| 1680 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { | 1692 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { |
| 1681 IndentedScope indent(this, "SUPER-CALL-REFERENCE", node->position()); | 1693 IndentedScope indent(this, "SUPER-CALL-REFERENCE", node->position()); |
| 1682 } | 1694 } |
| 1683 | 1695 |
| 1684 | 1696 |
| 1697 void AstPrinter::VisitRewritableAssignmentExpression( |
| 1698 RewritableAssignmentExpression* node) { |
| 1699 Visit(node->expression()); |
| 1700 } |
| 1701 |
| 1702 |
| 1685 #endif // DEBUG | 1703 #endif // DEBUG |
| 1686 | 1704 |
| 1687 } // namespace internal | 1705 } // namespace internal |
| 1688 } // namespace v8 | 1706 } // namespace v8 |
| OLD | NEW |