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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if (predicate) { | 111 if (predicate) { |
112 row.add(callback()); | 112 row.add(callback()); |
113 } else { | 113 } else { |
114 row.add(""); | 114 row.add(""); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 if (chunk.rule != null) { | 118 if (chunk.rule != null) { |
119 row.add(chunk.isHardSplit ? "" : chunk.rule.toString()); | 119 row.add(chunk.isHardSplit ? "" : chunk.rule.toString()); |
120 | 120 |
121 var outerRules = chunk.rule.outerRules.toSet().intersection(rules); | 121 var constrainedRules = |
122 writeIf(outerRules.isNotEmpty, () => "-> ${outerRules.join(" ")}"); | 122 chunk.rule.constrainedRules.toSet().intersection(rules); |
| 123 writeIf(constrainedRules.isNotEmpty, |
| 124 () => "-> ${constrainedRules.join(" ")}"); |
123 } else { | 125 } else { |
124 row.add("(no rule)"); | 126 row.add("(no rule)"); |
125 | 127 |
126 // Outer rules. | 128 // Outer rules. |
127 row.add(""); | 129 row.add(""); |
128 } | 130 } |
129 | 131 |
130 writeIf(chunk.indent != null && chunk.indent != 0, | 132 writeIf(chunk.indent != null && chunk.indent != 0, |
131 () => "indent ${chunk.indent}"); | 133 () => "indent ${chunk.indent}"); |
132 | 134 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 209 |
208 if (chunk.spaceWhenUnsplit) buffer.write(" "); | 210 if (chunk.spaceWhenUnsplit) buffer.write(" "); |
209 } | 211 } |
210 } | 212 } |
211 | 213 |
212 buffer.write(chunks.last.text); | 214 buffer.write(chunks.last.text); |
213 log(buffer); | 215 log(buffer); |
214 } | 216 } |
215 | 217 |
216 String _color(String ansiEscape) => useAnsiColors ? ansiEscape : ""; | 218 String _color(String ansiEscape) => useAnsiColors ? ansiEscape : ""; |
OLD | NEW |