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

Side by Side Diff: runtime/vm/ast_printer.cc

Issue 484933003: Await it! (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/ast_transformer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/ast_printer.h" 5 #include "vm/ast_printer.h"
6 6
7 #include "vm/handles.h" 7 #include "vm/handles.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 41
42 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { 42 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) {
43 VisitGenericAstNode(arguments); 43 VisitGenericAstNode(arguments);
44 } 44 }
45 45
46 46
47 void AstPrinter::VisitReturnNode(ReturnNode* node) { 47 void AstPrinter::VisitReturnNode(ReturnNode* node) {
48 VisitGenericAstNode(node); 48 VisitGenericAstNode(node);
49 OS::Print("(%s %s",
50 node->PrettyName(),
51 (node->return_type() == ReturnNode::kContinuation) ?
52 "continuation" : "");
53 node->VisitChildren(this);
54 OS::Print(")");
49 } 55 }
50 56
51 57
52 void AstPrinter::VisitGenericLocalNode(AstNode* node, 58 void AstPrinter::VisitGenericLocalNode(AstNode* node,
53 const LocalVariable& var) { 59 const LocalVariable& var) {
54 OS::Print("(%s %s%s \"%s\"", 60 OS::Print("(%s %s%s \"%s\"",
55 node->PrettyName(), 61 node->PrettyName(),
56 var.is_final() ? "final " : "", 62 var.is_final() ? "final " : "",
57 String::Handle(var.type().Name()).ToCString(), 63 String::Handle(var.type().Name()).ToCString(),
58 var.name().ToCString()); 64 var.name().ToCString());
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 node->VisitChildren(this); 156 node->VisitChildren(this);
151 OS::Print(")"); 157 OS::Print(")");
152 } 158 }
153 159
154 160
155 void AstPrinter::VisitAwaitNode(AwaitNode* node) { 161 void AstPrinter::VisitAwaitNode(AwaitNode* node) {
156 VisitGenericAstNode(node); 162 VisitGenericAstNode(node);
157 } 163 }
158 164
159 165
166 void AstPrinter::VisitAwaitMarkerNode(AwaitMarkerNode* node) {
167 VisitGenericAstNode(node);
168 }
169
170
160 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) { 171 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
161 OS::Print("*****%s***** \"%s\")", 172 OS::Print("*****%s***** \"%s\")",
162 node->PrettyName(), 173 node->PrettyName(),
163 node->primary().ToCString()); 174 node->primary().ToCString());
164 } 175 }
165 176
166 177
167 void AstPrinter::VisitComparisonNode(ComparisonNode* node) { 178 void AstPrinter::VisitComparisonNode(ComparisonNode* node) {
168 OS::Print("(%s %s ", node->PrettyName(), node->TokenName()); 179 OS::Print("(%s %s ", node->PrettyName(), node->TokenName());
169 node->VisitChildren(this); 180 node->VisitChildren(this);
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 ASSERT(node_sequence != NULL); 516 ASSERT(node_sequence != NULL);
506 AstPrinter ast_printer; 517 AstPrinter ast_printer;
507 const char* function_name = 518 const char* function_name =
508 parsed_function.function().ToFullyQualifiedCString(); 519 parsed_function.function().ToFullyQualifiedCString();
509 OS::Print("Ast for function '%s' {\n", function_name); 520 OS::Print("Ast for function '%s' {\n", function_name);
510 node_sequence->Visit(&ast_printer); 521 node_sequence->Visit(&ast_printer);
511 OS::Print("}\n"); 522 OS::Print("}\n");
512 } 523 }
513 524
514 } // namespace dart 525 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/ast_transformer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698