Text formatting rework

Rewrote main wrapping loop. Now uses iterators instead of indices and intermediate strings.
Differentiates between chars to wrap before, after or instead of.
Doesn’t preserve trailing newlines.
Wraps or more characters.
Dropped support for using tab character as an indent setting control char.
Hopefully avoids all the undefined behaviour and other bugs of the previous implementation.
This commit is contained in:
Phil Nash
2017-01-17 17:13:23 +00:00
parent 9a56609569
commit 4a04682e49
6 changed files with 325 additions and 130 deletions

View File

@@ -584,11 +584,11 @@ MiscTests.cpp:<line number>: FAILED:
CHECK( s1 == s2 )
with expansion:
"if ($b == 10) {
$a= 20;
$a = 20;
}"
==
"if ($b == 10) {
$a = 20;
$a = 20;
}
"
@@ -831,5 +831,5 @@ with expansion:
===============================================================================
test cases: 159 | 115 passed | 42 failed | 2 failed as expected
assertions: 909 | 813 passed | 78 failed | 18 failed as expected
assertions: 915 | 819 passed | 78 failed | 18 failed as expected