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

Side by Side Diff: pkg/compiler/lib/src/tree/unparser.dart

Issue 1155633002: Fix 56 hints in pkg/compiler (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
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 String unparse(Node node, {minify: true}) { 7 String unparse(Node node, {minify: true}) {
8 Unparser unparser = new Unparser(minify: minify); 8 Unparser unparser = new Unparser(minify: minify);
9 unparser.unparse(node); 9 unparser.unparse(node);
10 return unparser.result; 10 return unparser.result;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 visitBlock(Block node) => unparseBlockStatements(node.statements); 61 visitBlock(Block node) => unparseBlockStatements(node.statements);
62 62
63 unparseBlockStatements(NodeList statements) { 63 unparseBlockStatements(NodeList statements) {
64 addToken(statements.beginToken); 64 addToken(statements.beginToken);
65 65
66 Link<Node> nodes = statements.nodes; 66 Link<Node> nodes = statements.nodes;
67 if (nodes != null && !nodes.isEmpty) { 67 if (nodes != null && !nodes.isEmpty) {
68 indentMore(); 68 indentMore();
69 newline(); 69 newline();
70 visit(nodes.head); 70 visit(nodes.head);
71 String delimiter =
72 (statements.delimiter == null) ? "" : "${statements.delimiter}";
73 for (Link link = nodes.tail; !link.isEmpty; link = link.tail) { 71 for (Link link = nodes.tail; !link.isEmpty; link = link.tail) {
74 newline(); 72 newline();
75 visit(link.head); 73 visit(link.head);
76 } 74 }
77 indentLess(); 75 indentLess();
78 newline(); 76 newline();
79 } 77 }
80 if (statements.endToken != null) { 78 if (statements.endToken != null) {
81 write(statements.endToken.value); 79 write(statements.endToken.value);
82 } 80 }
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 850 }
853 851
854 visitStatement(Statement node) { 852 visitStatement(Statement node) {
855 throw 'internal error'; // Should not be called. 853 throw 'internal error'; // Should not be called.
856 } 854 }
857 855
858 visitStringNode(StringNode node) { 856 visitStringNode(StringNode node) {
859 throw 'internal error'; // Should not be called. 857 throw 'internal error'; // Should not be called.
860 } 858 }
861 } 859 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698