|
New, simpler and faster line splitter.
Instead of dynamic programming and memoization, this uses a more
straightforward search space exploration. It avoids the combinatorial
explosion by only trying splits inside long lines.
Performance is noticeably better across the board. It slightly
regresses on very nasty lines that do not end up fitting. In
return for that, it produces optimal output (i.e. without
pre-emption bugs) in many more cases, and faster output in cases
where the old splitter would bog down.
It is also less code and easier to maintain.
Fix #360. Fix #380.
R=kevmoo@google.com
Committed: 05712e0e0400de95e0ba6f9729410b3401fbc320
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+912 lines, -1033 lines) |
Patch |
|
M |
CHANGELOG.md
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
bin/format.dart
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
example/format.dart
|
View
|
1
|
2 chunks |
+120 lines, -14 lines |
0 comments
|
Download
|
|
M |
lib/src/chunk.dart
|
View
|
|
3 chunks |
+10 lines, -8 lines |
0 comments
|
Download
|
|
M |
lib/src/chunk_builder.dart
|
View
|
|
8 chunks |
+9 lines, -128 lines |
0 comments
|
Download
|
|
M |
lib/src/debug.dart
|
View
|
1
|
5 chunks |
+25 lines, -9 lines |
0 comments
|
Download
|
|
D |
lib/src/line_prefix.dart
|
View
|
|
1 chunk |
+0 lines, -120 lines |
0 comments
|
Download
|
|
M |
lib/src/line_splitter.dart
|
View
|
1
|
2 chunks |
+395 lines, -351 lines |
0 comments
|
Download
|
|
M |
lib/src/line_writer.dart
|
View
|
1
|
3 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
|
D |
lib/src/nesting.dart
|
View
|
|
1 chunk |
+0 lines, -291 lines |
0 comments
|
Download
|
|
M |
lib/src/nesting_builder.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
A |
lib/src/nesting_level.dart
|
View
|
1
|
1 chunk |
+78 lines, -0 lines |
0 comments
|
Download
|
|
M |
lib/src/rule/rule.dart
|
View
|
|
2 chunks |
+3 lines, -24 lines |
0 comments
|
Download
|
|
A |
lib/src/rule_set.dart
|
View
|
|
1 chunk |
+157 lines, -0 lines |
0 comments
|
Download
|
|
M |
pubspec.yaml
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
test/formatter_test.dart
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
test/regression/0100/0108.unit
|
View
|
|
3 chunks |
+22 lines, -56 lines |
0 comments
|
Download
|
|
M |
test/regression/0100/0198.stmt
|
View
|
|
1 chunk |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
test/regression/0200/0224.stmt
|
View
|
|
1 chunk |
+8 lines, -10 lines |
0 comments
|
Download
|
|
A |
test/regression/0300/0360.stmt
|
View
|
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
|
A |
test/regression/0300/0380.unit
|
View
|
|
1 chunk |
+23 lines, -0 lines |
0 comments
|
Download
|
|
M |
test/regression/other/analysis_server.unit
|
View
|
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
Total messages: 4 (1 generated)
|