Comment by feanaro
4 years ago
> And I don't see how it would be because of a disconnect between how a parser parses the code and how a human parses it. The parser has the same idea of closing braces belonging to particular opening constructs as humans do.
I don't understand the argument you made here. Why couldn't it do this?
Compared to the first snippet, in the second snippet:
1. There is still a function called `main`, but it has no lines, compared to a single line before. The conclusion is that this line was removed.
2. There is no longer an `add_one` function.
3. There are two new functions, `addition` and `add_two`.
This is exactly what your wanted diff is showing and all of those things can be determined by a parser.
I agree. I think you misinterpreted my comment. By "I don't see how it would be because of a disconnect", I meant "I don't see how the issue could be caused by a disconnect". (Maybe you read it as "I don't see how diffsitter would do that, because there's a disconnect"?) The suggestion of a disconnect came from the parent comment, and I was attempting to refute it.
Oops, yep. I mentally dropped a few words there from the quoted part, even though I re-read multiple times. Thanks for bearing with me.