Syntactic diffing with interpolation is an interesting problem.
Same: 1 + 2 vs 1+2
Different: "1 + 2" vs "1+2"
Same: "#{1 + 2}" vs "#{1+2}"
Difftastic is smart enough to get the first two cases correct, but still considers the third case to be different strings.
miniblog.
Related Posts
When a tool supports both regular expressions and literal strings, which should be the default?
If you default to regex, users can match more strings than they realise (e.g. `foo.txt`) or less (e.g. `foo(bar)`).
I typically see regex as the default, but I prefer the opposite.
I still find C-style format strings to be more readable than Rust format strings.
"Player %s has score %d" vs "Player {} has score {}".
The former feels a little easier to visualise how it will look in practice.
Have I missed anything? Every format string specification I've ever looked at is surprisingly big.
I've released difftastic 0.48! Highlights in this release:
* Subword highlighting in replaced strings! This is a big improvement in many situations.
* Better Scala parsing
* Better Haskell handling

