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

Side by Side Diff: lib/compiler/implementation/tree/nodes.dart

Issue 10456080: Remove printDebugInfo from Unparser (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Anton's comments. Created 8 years, 6 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 | « frog/tests/leg/resolver_test.dart ('k') | lib/compiler/implementation/tree/unparser.dart » ('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) 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 interface Visitor<R> { 5 interface Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCascade(Cascade node); 8 R visitCascade(Cascade node);
9 R visitCascadeReceiver(CascadeReceiver node); 9 R visitCascadeReceiver(CascadeReceiver node);
10 R visitCaseMatch(CaseMatch node); 10 R visitCaseMatch(CaseMatch node);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 static int _HASH_COUNTER = 0; 83 static int _HASH_COUNTER = 0;
84 84
85 Node() : _hashCode = ++_HASH_COUNTER; 85 Node() : _hashCode = ++_HASH_COUNTER;
86 86
87 hashCode() => _hashCode; 87 hashCode() => _hashCode;
88 88
89 abstract accept(Visitor visitor); 89 abstract accept(Visitor visitor);
90 90
91 abstract visitChildren(Visitor visitor); 91 abstract visitChildren(Visitor visitor);
92 92
93 toString() => unparse(false); 93 /**
94 94 * Returns this node unparsed to Dart source string.
95 toDebugString() => unparse(true); 95 */
ahe 2012/06/08 07:43:36 I assumed we would keep toDebugString, but use you
Roman 2012/06/08 08:13:12 Yes, that was the original plan. But then I saw th
ahe 2012/06/08 08:16:56 Yes. We often use the method for debugging by "pri
Roman 2012/06/08 12:33:33 I see. Got back toDebugString() that returns node
96 toString() => unparse();
96 97
97 String getObjectDescription() => super.toString(); 98 String getObjectDescription() => super.toString();
98 99
99 String unparse(bool printDebugInfo) { 100 String unparse() {
100 Unparser unparser = new Unparser(printDebugInfo); 101 Unparser unparser = new Unparser();
101 try { 102 try {
102 return unparser.unparse(this); 103 return unparser.unparse(this);
103 } catch (var e, var trace) { 104 } catch (var e, var trace) {
104 print(trace); 105 print(trace);
105 return '<<unparse error: ${getObjectDescription()}: ${unparser.sb}>>'; 106 return '<<unparse error: ${getObjectDescription()}: ${unparser.sb}>>';
106 } 107 }
107 } 108 }
108 109
109 abstract Token getBeginToken(); 110 abstract Token getBeginToken();
110 111
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 * argument). 1701 * argument).
1701 * 1702 *
1702 * TODO(ahe): This method is controversial, the team needs to discuss 1703 * TODO(ahe): This method is controversial, the team needs to discuss
1703 * if top-level methods are acceptable and what naming conventions to 1704 * if top-level methods are acceptable and what naming conventions to
1704 * use. 1705 * use.
1705 */ 1706 */
1706 initializerDo(Node node, f(Node node)) { 1707 initializerDo(Node node, f(Node node)) {
1707 SendSet send = node.asSendSet(); 1708 SendSet send = node.asSendSet();
1708 if (send !== null) return f(send.arguments.head); 1709 if (send !== null) return f(send.arguments.head);
1709 } 1710 }
OLDNEW
« no previous file with comments | « frog/tests/leg/resolver_test.dart ('k') | lib/compiler/implementation/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698