OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /// Internal debugging utilities. | 5 /// Internal debugging utilities. |
6 library dart_style.src.debug; | 6 library dart_style.src.debug; |
7 | 7 |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'chunk.dart'; | 10 import 'chunk.dart'; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Outer rules. | 121 // Outer rules. |
122 row.add(""); | 122 row.add(""); |
123 } | 123 } |
124 | 124 |
125 writeIf(chunk.indent != null && chunk.indent != 0, | 125 writeIf(chunk.indent != null && chunk.indent != 0, |
126 () => "indent ${chunk.indent}"); | 126 () => "indent ${chunk.indent}"); |
127 | 127 |
128 writeIf(chunk.nesting != null && chunk.nesting != 0, | 128 writeIf(chunk.nesting != null && chunk.nesting != 0, |
129 () => "nest ${chunk.nesting}"); | 129 () => "nest ${chunk.nesting}"); |
130 | 130 |
131 writeIf(chunk.flushLeft != null && chunk.flushLeft, | 131 writeIf(chunk.flushLeft != null && chunk.flushLeft, () => "flush"); |
132 () => "flush"); | |
133 | 132 |
134 rows.add(row); | 133 rows.add(row); |
135 | 134 |
136 for (var j = 0; j < chunk.blockChunks.length; j++) { | 135 for (var j = 0; j < chunk.blockChunks.length; j++) { |
137 addChunk(chunk.blockChunks[j], "$prefix$index.", j); | 136 addChunk(chunk.blockChunks[j], "$prefix$index.", j); |
138 } | 137 } |
139 } | 138 } |
140 | 139 |
141 var i = start; | 140 var i = start; |
142 for (var chunk in chunks) { | 141 for (var chunk in chunks) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } else { | 191 } else { |
193 if (chunk.spaceWhenUnsplit) buffer.write(" "); | 192 if (chunk.spaceWhenUnsplit) buffer.write(" "); |
194 } | 193 } |
195 } | 194 } |
196 | 195 |
197 buffer.write(chunks.last.text); | 196 buffer.write(chunks.last.text); |
198 log(buffer); | 197 log(buffer); |
199 } | 198 } |
200 | 199 |
201 String _color(String ansiEscape) => useAnsiColors ? ansiEscape : ""; | 200 String _color(String ansiEscape) => useAnsiColors ? ansiEscape : ""; |
OLD | NEW |