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

Side by Side Diff: lib/src/tree_base.dart

Issue 1969953002: Make TreeNode.visit return dynamic. (Closed) Base URL: git@github.com:dart-lang/csslib.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('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 part of csslib.visitor; 5 part of csslib.visitor;
6 6
7 /** 7 /**
8 * The base type for all nodes in a CSS abstract syntax tree. 8 * The base type for all nodes in a CSS abstract syntax tree.
9 */ 9 */
10 abstract class TreeNode { 10 abstract class TreeNode {
11 /** The source code this [TreeNode] represents. */ 11 /** The source code this [TreeNode] represents. */
12 final SourceSpan span; 12 final SourceSpan span;
13 13
14 TreeNode(this.span); 14 TreeNode(this.span);
15 15
16 TreeNode clone(); 16 TreeNode clone();
17 17
18 /** Classic double-dispatch visitor for implementing passes. */ 18 /** Classic double-dispatch visitor for implementing passes. */
19 void visit(VisitorBase visitor); 19 visit(VisitorBase visitor);
20 20
21 /** A multiline string showing the node and its children. */ 21 /** A multiline string showing the node and its children. */
22 String toDebugString() { 22 String toDebugString() {
23 var to = new TreeOutput(); 23 var to = new TreeOutput();
24 var tp = new _TreePrinter(to, true); 24 var tp = new _TreePrinter(to, true);
25 this.visit(tp); 25 this.visit(tp);
26 return to.buf.toString(); 26 return to.buf.toString();
27 } 27 }
28 } 28 }
29 29
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 writeln('null'); 88 writeln('null');
89 } 89 }
90 } 90 }
91 depth -= 1; 91 depth -= 1;
92 writeln(']'); 92 writeln(']');
93 } 93 }
94 } 94 }
95 95
96 String toString() => buf.toString(); 96 String toString() => buf.toString();
97 } 97 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698