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

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: Disable CrankShaft 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
« src/ast.h ('K') | « src/preparser.cc ('k') | src/rewriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
index 9fdd67b2ef3a2125809fbd96bcb2976dbaeae151..f50d5904d0a50ce0ed49c4de9c7121f8d03b7e0d 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(" ? ");
@@ -1425,6 +1435,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());
« src/ast.h ('K') | « src/preparser.cc ('k') | src/rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698