Chromium Code Reviews| Index: src/prettyprinter.cc |
| diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc |
| index d940704973ac788df3f3c55b0fbc3fe115f24f3f..da8124fac36683f6cc2cade317de72eb9cd2ceb7 100644 |
| --- a/src/prettyprinter.cc |
| +++ b/src/prettyprinter.cc |
| @@ -69,6 +69,35 @@ void PrettyPrinter::VisitVariableDeclaration(VariableDeclaration* node) { |
| } |
| +void PrettyPrinter::VisitModuleDeclaration(ModuleDeclaration* node) { |
| + Print("module "); |
| + PrintLiteral(node->proxy()->name(), false); |
| + Print(" = "); |
| + Visit(node->module()); |
| + Print(";"); |
| +} |
| + |
| + |
| +void PrettyPrinter::VisitModuleLiteral(ModuleLiteral* node) { |
| + VisitBlock(node->body()); |
| +} |
| + |
|
Jakob Kummerow
2012/02/09 13:18:35
nit: two empty lines
rossberg
2012/02/09 13:26:31
Done.
|
| +void PrettyPrinter::VisitModuleVariable(ModuleVariable* node) { |
| + PrintLiteral(node->var()->name(), false); |
| +} |
| + |
| +void PrettyPrinter::VisitModulePath(ModulePath* node) { |
| + Visit(node->module()); |
| + Print("."); |
| + PrintLiteral(node->name(), false); |
| +} |
| + |
| +void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) { |
| + Print("at "); |
| + PrintLiteral(node->url(), true); |
| +} |
| + |
| + |
| void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
| Visit(node->expression()); |
| Print(";"); |
| @@ -728,6 +757,32 @@ void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) { |
| } |
| +void AstPrinter::VisitModuleDeclaration(ModuleDeclaration* node) { |
| + IndentedScope indent(this, "MODULE"); |
| + PrintLiteralIndented("NAME", node->proxy()->name(), true); |
| + Visit(node->module()); |
| +} |
| + |
| + |
| +void AstPrinter::VisitModuleLiteral(ModuleLiteral* node) { |
| + VisitBlock(node->body()); |
| +} |
| + |
|
Jakob Kummerow
2012/02/09 13:18:35
same here
rossberg
2012/02/09 13:26:31
Done.
|
| +void AstPrinter::VisitModuleVariable(ModuleVariable* node) { |
| + PrintLiteralIndented("VARIABLE", node->var()->name(), false); |
| +} |
| + |
| +void AstPrinter::VisitModulePath(ModulePath* node) { |
| + IndentedScope indent(this, "PATH"); |
| + PrintIndentedVisit("MODULE", node->module()); |
| + PrintLiteralIndented("NAME", node->name(), false); |
| +} |
| + |
| +void AstPrinter::VisitModuleUrl(ModuleUrl* node) { |
| + PrintLiteralIndented("URL", node->url(), true); |
| +} |
| + |
| + |
| void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { |
| Visit(node->expression()); |
| } |