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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of tree; 5 part of tree;
6 6
7 /** 7 /**
8 * Pretty-prints Node tree in XML-like format. 8 * Pretty-prints Node tree in XML-like format.
9 * 9 *
10 * TODO(smok): Add main() to run from command-line to print out tree for given 10 * TODO(smok): Add main() to run from command-line to print out tree for given
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 addTypeWithParams(tag); 83 addTypeWithParams(tag);
84 sb.write(">\n"); 84 sb.write(">\n");
85 } 85 }
86 86
87 void addTypeWithParams(String type, [Map params]) { 87 void addTypeWithParams(String type, [Map params]) {
88 if (params == null) params = new Map(); 88 if (params == null) params = new Map();
89 sb.write("${type}"); 89 sb.write("${type}");
90 params.forEach((k, v) { 90 params.forEach((k, v) {
91 String value; 91 String value;
92 if (v != null) { 92 if (v != null) {
93 value = v 93 var str = v;
94 if (v is Token) str = v.value;
95 value = str
94 .replaceAll("<", "&lt;") 96 .replaceAll("<", "&lt;")
95 .replaceAll(">", "&gt;") 97 .replaceAll(">", "&gt;")
96 .replaceAll('"', "'"); 98 .replaceAll('"', "'");
97 } else { 99 } else {
98 value = "[null]"; 100 value = "[null]";
99 } 101 }
100 sb.write(' $k="$value"'); 102 sb.write(' $k="$value"');
101 }); 103 });
102 } 104 }
103 105
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 475 }
474 476
475 visitStringNode(StringNode node) { 477 visitStringNode(StringNode node) {
476 unimplemented('visitNode', node: node); 478 unimplemented('visitNode', node: node);
477 } 479 }
478 480
479 unimplemented(String message, {Node node}) { 481 unimplemented(String message, {Node node}) {
480 throw message; 482 throw message;
481 } 483 }
482 } 484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698