digitalmars.D - Lexical, Syntatic and Semantic Merge of D Source Code
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (21/21) Jul 11 2014 Now that we have reasonable support for lexing and parsing D in D
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/4) Jul 11 2014 On Friday, 11 July 2014 at 13:58:53 UTC, Nordlöw wrote:
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/5) Jul 11 2014 Correction: If mean
- Joakim (4/25) Jul 12 2014 It's a good idea, something I've thought would be nice before,
- Stefan Koch (4/6) Jul 13 2014 There is something I found a great insperation is coccinelle
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?
Jul 11 2014
On Friday, 11 July 2014 at 13:58:53 UTC, Nordlöw wrote: Other languages already have this through proprietary software. See for example http://www.semanticmerge.com/
Jul 11 2014
On Friday, 11 July 2014 at 13:58:53 UTC, Nordlöw wrote:the effort to try to implement D-specific merge algorithms thatCorrection: If mean the effort to try to implement D-specific diff and merge algorithms .
Jul 11 2014
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/sggntfmffiicpymovtys forum.dlang.org?page=2#post-ughxvktaonclzddyicve:40forum.dlang.org
Jul 12 2014
On Saturday, 12 July 2014 at 10:08:35 UTC, Joakim wrote:It's a good idea, something I've thought would be nice before, and a first step towards the Dfix concept Andrei has endorsed:There is something I found a great insperation is coccinelle http://coccinelle.lip6.fr/ it looks like a perfect match for starting the dfix endevaur
Jul 13 2014