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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 break; | 1056 break; |
1057 case VariableLocation::CONTEXT: | 1057 case VariableLocation::CONTEXT: |
1058 SNPrintF(buf + pos, " context[%d]", var->index()); | 1058 SNPrintF(buf + pos, " context[%d]", var->index()); |
1059 break; | 1059 break; |
1060 case VariableLocation::GLOBAL: | 1060 case VariableLocation::GLOBAL: |
1061 SNPrintF(buf + pos, " global[%d]", var->index()); | 1061 SNPrintF(buf + pos, " global[%d]", var->index()); |
1062 break; | 1062 break; |
1063 case VariableLocation::LOOKUP: | 1063 case VariableLocation::LOOKUP: |
1064 SNPrintF(buf + pos, " lookup"); | 1064 SNPrintF(buf + pos, " lookup"); |
1065 break; | 1065 break; |
| 1066 case VariableLocation::MODULE: |
| 1067 SNPrintF(buf + pos, " module"); |
| 1068 break; |
1066 } | 1069 } |
1067 PrintLiteralWithModeIndented(buf.start(), var, node->name()); | 1070 PrintLiteralWithModeIndented(buf.start(), var, node->name()); |
1068 } | 1071 } |
1069 } | 1072 } |
1070 | 1073 |
1071 | 1074 |
1072 void AstPrinter::VisitAssignment(Assignment* node) { | 1075 void AstPrinter::VisitAssignment(Assignment* node) { |
1073 IndentedScope indent(this, Token::Name(node->op()), node->position()); | 1076 IndentedScope indent(this, Token::Name(node->op()), node->position()); |
1074 Visit(node->target()); | 1077 Visit(node->target()); |
1075 Visit(node->value()); | 1078 Visit(node->value()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1192 |
1190 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1193 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
1191 Visit(node->expression()); | 1194 Visit(node->expression()); |
1192 } | 1195 } |
1193 | 1196 |
1194 | 1197 |
1195 #endif // DEBUG | 1198 #endif // DEBUG |
1196 | 1199 |
1197 } // namespace internal | 1200 } // namespace internal |
1198 } // namespace v8 | 1201 } // namespace v8 |
OLD | NEW |