On Friday, 11 July 2014 at 13:58:53 UTC, Nordlöw wrote:
Now that we have reasonable support for lexing and parsing D in D through Dscanner/libdparse/DCD I believe it would be worth the effort to try to implement D-specific merge algorithms that operate on either the

- D token stream or
- a D parse tree

possibly making use of semantic information.

This would also require functions that write them back to the original source representation, of course preserving whitespace indentations.

A token-based merger would be quite easy to implement and will resolve conflicts where multiple symbol renamings have occurred on the same line. Something that current mainstream line-based algorithms cannot handle. This could be useful when test-merging Git branches on Github.

It also could be that these algorithms will have things in common with DustMite's algorithms. What do you say, Cybershadow?

I could help implementing these ideas when necessary.

Have perhaps anybody already cooked up some D implementations of generic diff/merge algorithms? If not could anybody point out a good reference implementation in C/C++ to start with?

It's a good idea, something I've thought would be nice before, and a first step towards the Dfix concept Andrei has endorsed:

http://forum.dlang.org/thread/[email protected]?page=2#post-ughxvktaonclzddyicve:40forum.dlang.org

Reply via email to