Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Unified Diff: src/prettyprinter.cc

Issue 1399893002: [es7] implement |do| expressions proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Less code duplication in Rewriter Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/prettyprinter.cc
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
index 3efdfb61143f02272772b7070ae586c2328074c8..7df0e01808feec4f2366e33a35feebaed4448937 100644
--- a/src/prettyprinter.cc
+++ b/src/prettyprinter.cc
@@ -228,6 +228,9 @@ void CallPrinter::VisitClassLiteral(ClassLiteral* node) {
void CallPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {}
+void CallPrinter::VisitDoExpression(DoExpression* node) { Find(node->block()); }
+
+
void CallPrinter::VisitConditional(Conditional* node) {
Find(node->condition());
Find(node->then_expression());
@@ -701,6 +704,13 @@ void PrettyPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
}
+void PrettyPrinter::VisitDoExpression(DoExpression* node) {
+ Print("(do {");
+ PrintStatements(node->block()->statements());
+ Print("})");
+}
+
+
void PrettyPrinter::VisitConditional(Conditional* node) {
Visit(node->condition());
Print(" ? ");
@@ -1426,6 +1436,12 @@ void AstPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {
}
+void AstPrinter::VisitDoExpression(DoExpression* node) {
+ IndentedScope indent(this, "DO EXPRESSION", node->position());
+ PrintStatements(node->block()->statements());
+}
+
+
void AstPrinter::VisitConditional(Conditional* node) {
IndentedScope indent(this, "CONDITIONAL", node->position());
PrintIndentedVisit("CONDITION", node->condition());

Powered by Google App Engine
This is Rietveld 408576698