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

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

Issue 10909098: Fix Token::kAS and its printing according to Regis' comment. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | runtime/vm/token.h » ('j') | runtime/vm/token.h » ('J')
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 152
153 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) { 153 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
154 OS::Print("***** PRIMARY NODE IN AST ***** (%s '%s')", 154 OS::Print("***** PRIMARY NODE IN AST ***** (%s '%s')",
155 node->Name(), node->primary().ToCString()); 155 node->Name(), node->primary().ToCString());
156 } 156 }
157 157
158 158
159 void AstPrinter::VisitComparisonNode(ComparisonNode* node) { 159 void AstPrinter::VisitComparisonNode(ComparisonNode* node) {
160 VisitGenericAstNode(node); 160 if (node->kind() == Token::kAS) {
161 OS::Print("(as ");
162 node->VisitChildren(this);
163 OS::Print(")");
164 } else {
165 VisitGenericAstNode(node);
166 }
161 } 167 }
162 168
163 169
164 void AstPrinter::VisitBinaryOpNode(BinaryOpNode* node) { 170 void AstPrinter::VisitBinaryOpNode(BinaryOpNode* node) {
165 VisitGenericAstNode(node); 171 VisitGenericAstNode(node);
166 } 172 }
167 173
168 174
169 void AstPrinter::VisitUnaryOpNode(UnaryOpNode* node) { 175 void AstPrinter::VisitUnaryOpNode(UnaryOpNode* node) {
170 VisitGenericAstNode(node); 176 VisitGenericAstNode(node);
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 ASSERT(node_sequence != NULL); 490 ASSERT(node_sequence != NULL);
485 AstPrinter ast_printer; 491 AstPrinter ast_printer;
486 const char* function_name = 492 const char* function_name =
487 parsed_function.function().ToFullyQualifiedCString(); 493 parsed_function.function().ToFullyQualifiedCString();
488 OS::Print("Ast for function '%s' {\n", function_name); 494 OS::Print("Ast for function '%s' {\n", function_name);
489 node_sequence->Visit(&ast_printer); 495 node_sequence->Visit(&ast_printer);
490 OS::Print("}\n"); 496 OS::Print("}\n");
491 } 497 }
492 498
493 } // namespace dart 499 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/token.h » ('j') | runtime/vm/token.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698