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

Unified Diff: lib/compiler/implementation/tree/unparser.dart

Issue 10387080: Accept more labels per switch case. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/tree/nodes.dart ('k') | lib/compiler/implementation/tree/visitors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/unparser.dart
diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
index 17852756cf2781af25b2609512899147492ac7cb..6349c30a1a290d1ddc24bb81f403ac5db1786ddb 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -347,15 +347,7 @@ class Unparser implements Visitor {
}
visitSwitchCase(SwitchCase node) {
- if (node.label !== null) {
- visit(node.label);
- sb.add(': ');
- }
- for (Expression expression in node.expressions) {
- sb.add('case ');
- visit(expression);
- sb.add(': ');
- }
+ visit(node.labelsAndCases);
if (node.isDefaultCase) {
sb.add('default:');
}
@@ -389,6 +381,13 @@ class Unparser implements Visitor {
}
}
+ visitCaseMatch(CaseMatch node) {
+ add(node.caseKeyword.value);
+ sb.add(" ");
+ visit(node.expression);
+ add(node.colonToken.value);
+ }
+
visitCatchBlock(CatchBlock node) {
add(node.catchKeyword.value);
sb.add(' ');
« no previous file with comments | « lib/compiler/implementation/tree/nodes.dart ('k') | lib/compiler/implementation/tree/visitors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698