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

Side by Side Diff: tree.dart

Issue 8343037: Throw FallThroughError when we fall through a case in a switch statement. Fixes (Closed) Base URL: http://dart.googlecode.com/svn/experimental/frog/
Patch Set: '' Created 9 years, 1 month 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
« parser.dart ('K') | « tests/frog/frog.status ('k') | no next file » | 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 * The base type for all nodes in a dart abstract syntax tree. 5 * The base type for all nodes in a dart abstract syntax tree.
6 */ 6 */
7 class Node { 7 class Node {
8 /** The source code this [Node] represents. */ 8 /** The source code this [Node] represents. */
9 SourceSpan span; 9 SourceSpan span;
10 10
11 Node(this.span) {} 11 Node(this.span) {}
12 12
13 /** Classic double-dispatch visitor for implementing passes. */ 13 /** Classic double-dispatch visitor for implementing passes. */
14 abstract void visit(TreeVisitor visitor); 14 abstract visit(TreeVisitor visitor);
jimhug 2011/10/28 20:02:44 Good catch.
15 15
16 /** A multiline string showing the node and its children. */ 16 /** A multiline string showing the node and its children. */
17 String toDebugString() { 17 String toDebugString() {
18 var to = new TreeOutput(); 18 var to = new TreeOutput();
19 var tp = new TreePrinter(to); 19 var tp = new TreePrinter(to);
20 this.visit(tp); 20 this.visit(tp);
21 return to.buf.toString(); 21 return to.buf.toString();
22 } 22 }
23 } 23 }
24 24
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (node != null) { 121 if (node != null) {
122 node.visit(printer); 122 node.visit(printer);
123 } else { 123 } else {
124 writeln('null'); 124 writeln('null');
125 } 125 }
126 } 126 }
127 depth -= 1; 127 depth -= 1;
128 } 128 }
129 } 129 }
130 } 130 }
OLDNEW
« parser.dart ('K') | « tests/frog/frog.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698