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

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

Issue 1346093003: Revert "Add optional message to assert in Dart2js - continued" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « pkg/compiler/lib/src/tree/prettyprint.dart ('k') | pkg/compiler/lib/src/typechecker.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 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 sb.write(s); 51 sb.write(s);
52 onEmptyLine = false; 52 onEmptyLine = false;
53 } 53 }
54 54
55 unparse(Node node) { visit(node); } 55 unparse(Node node) { visit(node); }
56 56
57 visit(Node node) { 57 visit(Node node) {
58 if (node != null) node.accept(this); 58 if (node != null) node.accept(this);
59 } 59 }
60 60
61 visitAssert(Assert node) {
62 write(node.assertToken.value);
63 write('(');
64 visit(node.condition);
65 if (node.hasMessage) {
66 write(',');
67 space();
68 visit(node.message);
69 }
70 write(');');
71 }
72
73 visitBlock(Block node) => unparseBlockStatements(node.statements); 61 visitBlock(Block node) => unparseBlockStatements(node.statements);
74 62
75 unparseBlockStatements(NodeList statements) { 63 unparseBlockStatements(NodeList statements) {
76 addToken(statements.beginToken); 64 addToken(statements.beginToken);
77 65
78 Link<Node> nodes = statements.nodes; 66 Link<Node> nodes = statements.nodes;
79 if (nodes != null && !nodes.isEmpty) { 67 if (nodes != null && !nodes.isEmpty) {
80 indentMore(); 68 indentMore();
81 newline(); 69 newline();
82 visit(nodes.head); 70 visit(nodes.head);
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 855 }
868 856
869 visitStatement(Statement node) { 857 visitStatement(Statement node) {
870 throw 'internal error'; // Should not be called. 858 throw 'internal error'; // Should not be called.
871 } 859 }
872 860
873 visitStringNode(StringNode node) { 861 visitStringNode(StringNode node) {
874 throw 'internal error'; // Should not be called. 862 throw 'internal error'; // Should not be called.
875 } 863 }
876 } 864 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree/prettyprint.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698