Index: src/prettyprinter.cc |
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc |
index d940704973ac788df3f3c55b0fbc3fe115f24f3f..685e443e243584bb032ee7682cf83ee6a68fd274 100644 |
--- a/src/prettyprinter.cc |
+++ b/src/prettyprinter.cc |
@@ -69,6 +69,38 @@ 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()); |
+} |
+ |
+ |
+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 +760,35 @@ 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()); |
+} |
+ |
+ |
+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()); |
} |